====== CentOS6(RHEL6) 網路相關設定方式 ======
CentOS6(RHEL6) 在網路設定上改變很多.. 陸續將設定差異整理在這頁面.
===== static route =====
CentOS 5 之前版本要增加
route add -net 192.168.16.0/24 gw 192.168.11.249
CentOS 6 要改成使用 iproute2 的設定方式
* 先在 /etc/iptoute2/rt_tables 建立要採用的 table Exp. admin
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
1 admin
最後一行** 1 admin**就是新增加上去的部分
* 建立 ip route 的規則
ip route add 192.168.16.0/24 via 192.168.11.249 dev eth1 table admin
* 檢查建立規則
[root@pdc-e2160 iproute2]# ip route list table admin
192.168.16.0/24 via 192.168.11.249 dev eth1
* 讓規則生效
ip rule add to 192.168.16.0/24 table admin
* 檢查目前生效規則
[root@pdc-e2160 iproute2]# ip rule
0: from all lookup local
32765: from all to 192.168.16.0/24 lookup admin
32766: from all lookup main
32767: from all lookup default
==== 參考網址 ====
* http://centos.org/modules/newbb/viewtopic.php?topic_id=33541&forum=58
{{tag>centos6 tips}}