需求描述 不通的网络环境下,可能需要设置静态IP地址,或设置为动态获取,每次重复手动的配置费时费力,通过脚本可以实现一键设置 脚本实现 1.设置静态IP 1.1新建文本文档,复制粘贴如下内容 netsh interface ip set address name= netsh interface ip set dns name="本地连接" source=static addr=202.196.64.1 1.2修改文件后缀名为 .bat 1.3鼠标右键以管理员身份运行上述bat脚本即…
1.改动 ip地址 子网掩码 默认网关 netsh interface ip set address "本地连接" static 192.168.1.23 255.255.255.0 192.168.1.1 2.改动DNS netsh interface ip set dns "本地连接" static 192.168.1.1 primary 3.自己主动获取ip地址 netsh interface ip set address name="本地连接&qu…
@echo off :startIP set /p source=STATIC Y or N or E: echo source:%source% if "%source%" == "y" ( goto staticIP ) if "%source%" == "n" ( goto dhcpIP ) if "%source%" == "e" ( goto exitSet ) :static…
人狠话不多,直接上代码:------------------------------------------------------------------------------------- local headers=ngx.req.get_headers() local clientIP = headers["x-forwarded-for"] or clientIP == "unknown" then clientIP = headers["Pr…