route命令详解


当前第2页 返回上一页

增加一条屏蔽的路由,目的地址为 224.x.x.x 将被拒绝

实例4:删除路由记录

命令:

1

2

route del -net 224.0.0.0 netmask 240.0.0.0

route del -net 224.0.0.0 netmask 240.0.0.0 reject

输出:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

[root@localhost ~]# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.120.0   *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.120.1   255.255.0.0     UG    0      0        0 eth0

10.0.0.0        192.168.120.1   255.0.0.0       UG    0      0        0 eth0

224.0.0.0       -               240.0.0.0       !     0      -        0 -

224.0.0.0       *               240.0.0.0       U     0      0        0 eth0

default         192.168.120.240 0.0.0.0         UG    0      0        0 eth0

[root@localhost ~]# route del -net 224.0.0.0 netmask 240.0.0.0

[root@localhost ~]# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.120.0   *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.120.1   255.255.0.0     UG    0      0        0 eth0

10.0.0.0        192.168.120.1   255.0.0.0       UG    0      0        0 eth0

224.0.0.0       -               240.0.0.0       !     0      -        0 -

default         192.168.120.240 0.0.0.0         UG    0      0        0 eth0

[root@localhost ~]# route del -net 224.0.0.0 netmask 240.0.0.0 reject

[root@localhost ~]# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.120.0   *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.120.1   255.255.0.0     UG    0      0        0 eth0

10.0.0.0        192.168.120.1   255.0.0.0       UG    0      0        0 eth0

default         192.168.120.240 0.0.0.0         UG    0      0        0 eth0

[root@localhost ~]#

说明:

实例5:删除和添加设置默认网关

命令:

1

2

route del default gw 192.168.120.240

route add default gw 192.168.120.240

输出:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

[root@localhost ~]# route del default gw 192.168.120.240

[root@localhost ~]# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.120.0   *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.120.1   255.255.0.0     UG    0      0        0 eth0

10.0.0.0        192.168.120.1   255.0.0.0       UG    0      0        0 eth0

[root@localhost ~]# route add default gw 192.168.120.240

[root@localhost ~]# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.120.0   *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     192.168.120.1   255.255.0.0     UG    0      0        0 eth0

10.0.0.0        192.168.120.1   255.0.0.0       UG    0      0        0 eth0

default         192.168.120.240 0.0.0.0         UG    0      0        0 eth0

[root@localhost ~]#

以上就是route命令详解的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

Route命令详解

Route add如何添加静态路由

Route add命令如何使用

Route add命令如何使用

Route add如何添加静态路由

Route命令详解

更多相关阅读请进入《Route》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...