def ifconfig():
import network
sta_if = network.WLAN(network.STA_IF)
if sta_if.active() :
(ip, subnet, gateway, dns) = sta_if.ifconfig()
print("Station:\n\tip: {}\n\tsubnet: {}\n\tgateway: {}\n\tdns: {}".format(ip, subnet, gateway, dns))
ap_if = network.WLAN(network.AP_IF)
if ap_if.active() :
(ip, subnet, gateway, dns) = ap_if.ifconfig()
print("Access Point:\n\tip: {}\n\tsubnet: {}\n\tgateway: {}\n\tdns: {}".format(ip, subnet, gateway, dns))
评论列表
文章目录