Board logo

標題: how to set centos route table (multi gateway) [打印本頁]

作者: warrior    時間: 2016-12-31 01:11     標題: how to set centos route table (multi gateway)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.12.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.13.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1
0.0.0.0         192.168.13.1    0.0.0.0         UG    0      0        0 eth1

how can I set
192.168.12.0 via gateway 192.168.12.254 dev eth0? thanks
作者: CamEL_    時間: 2016-12-31 02:49

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Ifac ...
warrior 發表於 2016-12-31 01:11


route add -net 192.168.12.0 netmask 255.255.255.0 gw 192.168.12.254 dev eth0
作者: 普羅    時間: 2016-12-31 15:11

本帖最後由 普羅 於 2016-12-31 15:12 編輯

係 /etc/sysconfig/network-scripts/ 起個 route-eth0 file 入面入route list, boot 機自動route
作者: warrior    時間: 2017-1-1 11:58

我兩個試左都唔得 唔知SET 錯咩 都係行返DEFAULT GW (0.0.0.0)

ps  I am using centos 6.5
作者: shadowguy    時間: 2017-1-3 12:10

Refer to https://www.centos.org/forums/viewtopic.php?t=44935
what is your /etc/sysconfig/network-scripts/route-eth0??
作者: warrior    時間: 2017-1-3 23:17

done, 自己白痴 有其他setting 撞左 上面兩個method 都work





歡迎光臨 電腦領域 HKEPC Hardware (https://www.hkepc.com/forum/) Powered by Discuz! 7.2