#coding=utf-8
import os
import time
# 修改静态ip
#static = os.popen('netsh interface ipv4 set address "eth17" static 192.168.2.166 255.255.255.0')
# 禁用网卡
os.popen('netsh interface set interface "test" admin=DISABLE')
#time.sleep(3)
# 启用网卡
os.popen('netsh interface set interface "eth17" admin=ENABLE')
# 修改动态ip
os.popen('netsh interface ipv4 set address "eth17" dhcp')
Python2.7 设置本地网卡
于 2024-06-19 16:04:07 首次发布