读书人

Seamlessly use WANO and intranet at

发布时间: 2014-06-03 16:43:24 作者: rapoo

Seamlessly use WANO and intranet at the same time.

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

steps:

    switch on wireless card on your laptopget the latest wano user/password, you will need it when you access internet.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

读书人网 >操作系统

热点推荐