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";
    }






  • 相关阅读:
    Shell编程—用户输入
    Shell编程—结构化命令
    Shell编程—基础脚本
    跳表
    分布式项目——电商秒杀
    Dubbo详解
    Kafka工作流程
    Kafka内部实现原理
    Zk实现分布式锁
    Leetcode::Pathsum & Pathsum II
  • 原文地址:https://www.cnblogs.com/yyangblog/p/2208256.html
Copyright © 2011-2022 走看看