Post

routes

routes

route add

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
sudo ip route add 10.0.0.0/8   via 10.61.64.1
sudo ip route add 100.64.0.0/10 via 10.61.64.1
sudo ip route add 127.0.0.0/8 via 10.61.64.1
sudo ip route add 172.16.0.0/12 via 10.61.64.1
sudo ip route add 192.168.0.0/16 via 10.61.64.1
sudo ip route add 220.181.111.0/24 via 10.61.64.1
sudo ip route add 223.5.5.5/32  via 10.61.64.1


效果
0 zhang@zhang:/usr/local/bin$ route -n
内核 IP 路由表
目标            网关            子网掩码        标志  跃点   引用  使用 接口
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 enp0s20f0u14
10.61.64.0      0.0.0.0         255.255.224.0   U     0      0        0 eno1
100.64.0.0      10.61.64.1      255.192.0.0     UG    0      0        0 eno1
127.0.0.0       10.61.64.1      255.0.0.0       UG    0      0        0 eno1
172.16.0.0      10.61.64.1      255.240.0.0     UG    0      0        0 eno1
192.168.0.0     10.61.64.1      255.255.0.0     UG    0      0        0 eno1
220.181.111.0   10.61.64.1      255.255.255.0   UG    0      0        0 eno1

route delelte

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
route del -net 10.61.64.0 netmask 255.255.224.0
route del -net 172.17.0.0 netmask 255.255.0.0
route del -net 192.168.0.0 netmask 255.255.255.0

# ip route del 220.181.111.0
# ip route del 10.0.0.0
# ip route del 172.16.0.0
# ip route del 127.0.0.0
# ip route del 100.64.0.0

# route del -net 100.64.0.0 gw 10.61.64.1 netmask 255.192.0.0 dev eno1
# route del -net 172.16.0.0 gw 10.61.64.1 netmask 255.240.0.0 dev eno1
# route del -net 127.0.0.0 gw 10.61.64.1 netmask 255.192.0.0 dev eno1
# route del -net 172.16.0.0 gw 10.61.64.1 netmask 255.240.0.0 dev eno1

# route del -net 172.16.0.0/12 gw 10.61.64.1 dev eno1
# 
# route del -net 10.0.0.0  gw 10.61.64.1  netmask 255.0.0.0 dev eno1
# 
# sudo route del default gw 10.61.64.1
# 
# sudo route del -net 192.168.0.0 netmask 255.255.255.0

This post is licensed under CC BY 4.0 by the author.