Last login: Fri Oct 27 16:46:14 2017 from 192.168.1.168
[galen@sh45 ~]$ ls
anaconda2 jianshu_spider.py spider_school
ip route del default
Anaconda2-4.0.0-Linux-x86_64.sh spider_POI
ip route del default
[galen@sh45 ~]$ ip r
172.16.2.0/24 dev eth1 proto kernel scope link src 172.16.2.45
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.45
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
default via 172.16.2.44 dev eth1
[galen@sh45 ~]$ ip route del default
RTNETLINK answers: Operation not permitted
[galen@sh45 ~]$ sudo su -
[sudo] password for galen:
[root@sh45 ~]# cd
[root@sh45 ~]# pwd
/root
[root@sh45 ~]# ip route del default
[root@sh45 ~]# ip r
172.16.2.0/24 dev eth1 proto kernel scope link src 172.16.2.45
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.45
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
[root@sh45 ~]# ip route add default via 192.168.1.44
[root@sh45 ~]# curl ip.cn
当前 IP:123.160.198.122 来自:河南省三门峡市 电信
[root@sh45 ~]# vi route_normal.sh
[root@sh45 ~]# vi route_pptp.sh
[root@sh45 ~]# ll
total 68
drwxr-xr-x 17 root root 4096 Aug 21 15:30 anaconda2
-rw-------. 1 root root 1299 Aug 18 03:25 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Aug 21 14:52 info
-rw-r--r--. 1 root root 28529 Aug 18 03:25 install.log
-rw-r--r--. 1 root root 7572 Aug 18 03:24 install.log.syslog
drwxr-xr-x 3 root root 4096 Aug 21 14:52 lib
-rw-r--r-- 1 root root 58 Oct 31 17:04 route_normal.sh
-rw-r--r-- 1 root root 59 Oct 31 17:05 route_pptp.sh
drwxr-xr-x 2 root root 4096 Aug 18 13:39 soft
[root@sh45 ~]# chmod +x route*
[root@sh45 ~]# ll
total 68
drwxr-xr-x 17 root root 4096 Aug 21 15:30 anaconda2
-rw-------. 1 root root 1299 Aug 18 03:25 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 Aug 21 14:52 info
-rw-r--r--. 1 root root 28529 Aug 18 03:25 install.log
-rw-r--r--. 1 root root 7572 Aug 18 03:24 install.log.syslog
drwxr-xr-x 3 root root 4096 Aug 21 14:52 lib
-rwxr-xr-x 1 root root 58 Oct 31 17:04 route_normal.sh
-rwxr-xr-x 1 root root 59 Oct 31 17:05 route_pptp.sh
drwxr-xr-x 2 root root 4096 Aug 18 13:39 soft
[root@sh45 ~]# ./route_normal.sh
[root@sh45 ~]# ip r
172.16.2.0/24 dev eth1 proto kernel scope link src 172.16.2.45
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.45
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
default via 192.168.1.1 dev eth0
[root@sh45 ~]# curl ip.cn
当前 IP:101.81.127.20 来自:上海市 电信
[root@sh45 ~]# ./route_pptp.sh
[root@sh45 ~]# ip r
172.16.2.0/24 dev eth1 proto kernel scope link src 172.16.2.45
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.45
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
default via 192.168.1.44 dev eth0
[root@sh45 ~]# curl ip.cn
当前 IP:115.202.52.157 来自:浙江省台州市 电信
[root@sh45 ~]# ls
anaconda2 info install.log.syslog route_normal.sh soft
anaconda-ks.cfg install.log lib route_pptp.sh
[root@sh45 ~]#
ip route
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- Linux 使用 ip route , ip rule , iptables 配置策略路由 要求192.168.0...