系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux下route命令實(shí)例

Linux下route命令操作實(shí)例匯總(3)

時(shí)間:2014-12-29 17:05:47 作者:qipeng 來源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20141229/33646.html 手機(jī)查看 評論

  實(shí)例4:刪除路由記錄

  命令:

  代碼如下:

  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

  輸出:

  代碼如下:

 。踨oot@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

 。踨oot@localhost ~]# route del -net 224.0.0.0 netmask 240.0.0.0

 。踨oot@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

 。踨oot@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

 。踨oot@localhost ~]#

  說明:

  實(shí)例5:刪除和添加設(shè)置默認(rèn)網(wǎng)關(guān)

  命令:

  代碼如下:

  route del default gw 192.168.120.240

  route add default gw 192.168.120.240

  輸出:

  代碼如下:

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

 。踨oot@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

 。踨oot@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

 。踨oot@localhost ~]#

  上面就是Linux下route命令的操作實(shí)例的介紹了,從本文的介紹我們可以知道,route命令除了能夠顯示路由表外,還能夠刪除路由記錄,屏蔽路由及設(shè)置網(wǎng)關(guān)。

標(biāo)簽 命令 route

發(fā)表評論

0

沒有更多評論了

評論就這些咯,讓大家也知道你的獨(dú)特見解

立即評論

以上留言僅代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

官方交流群 軟件收錄