`
gxrocky
  • 浏览: 31815 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
最近访客 更多访客>>
社区版块
存档分类
最新评论

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics