zoukankan      html  css  js  c++  java
  • 不同网段间的切换脚本

    经常在网段之间频繁切换,要重新设置IP,DNS服务器,代理地址实在是麻烦,

    使用脚本会方便很多。

    1、IP,DNS服务器切换脚本

    192.168.20.77.bat
    1 netsh interface ip set address local static 192.168.20.77 255.255.255.0 192.168.20.254 1
    2
    3 netsh interface ip set dns name="local" source=static addr=192.168.2.242 register=PRIMARY
    4
    5 netsh interface ip add dns name="local" addr=192.168.10.242 index=2
    192.168.1.50.bat
    1 netsh interface ip set address local static 192.168.1.50 255.255.255.0 192.168.1.1 1
    2
    3 netsh interface ip set dns name="local" source=static addr=192.168.1.1 register=PRIMARY

    2、代理自动配置脚本

     如果在不同网段使用的不同的代理,可使用代理的自动配置脚本。

    proxy.pac
    function FindProxyForURL(url,host)
    {

    if(myIpAddress()=="192.168.20.77")
    {
    return "PROXY 192.168.2.250:80";
    }

    if(myIpAddress()=="192.168.1.50")
    {
    return "PROXY 192.168.1.254:8080";
    }

    return "direct";
    }






  • 相关阅读:
    最简单跳转,待反混爻的合集
    搜索引擎劫持代码
    Warning: Cannot modify header information
    editplus 正则删换行
    在全程Linux環境部署IBM Lotus Domino/Notes 8.5
    3.5-杂项②
    3.4-杂项①
    3.3-ISDN
    3.2-帧中继②
    3.2-帧中继①
  • 原文地址:https://www.cnblogs.com/yyangblog/p/2208256.html
Copyright © 2011-2022 走看看