Seamlessly use WANO and intranet at the same time.

Linux users in intranet can use WANO and intranet at the same time seamlessly.

steps:

  1. switch on wireless card on your laptop
  2. get the latest wano user/password, you will need it when you access internet.
  3. just create this shell script and exec the shell script

current_default_gw=`route -n | grep '^0\.0\.\0\.0[ \t]\+[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*[ \t]\+0\.0\.0\.0[ \t]\+[^ \t]*G[^ \t]*[ \t]' | awk '{print $2}'`

sudo route del default
sudo route add default gw 10.254.92.1 dev wlan0
if [ x$1 != 'x' ] ; then
    #in case you are not using this default gateway, you can specify your eth0 gateway
    gw=$1
else
   
    gw=${current_default_gw}
fi

#All started with 10.xxx.xxx.xxx

sudo route add -net 10.0.0.0 netmask 255.0.0.0 gw ${gw} dev eth0

#your  local route which not start with 10.*
sudo route add -net 93.183.1.0 netmask 255.255.255.0 gw ${gw} dev eth0
sudo route add -net 87.254.0.0 netmask 255.255.0.0 gw ${gw} dev eth0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值