顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== CentOS6(RHEL6) 網路相關設定方式 ====== CentOS6(RHEL6) 在網路設定上改變很多.. 陸續將設定差異整理在這頁面. ===== static route ===== CentOS 5 之前版本要增加 <code> route add -net 192.168.16.0/24 gw 192.168.11.249 </code> CentOS 6 要改成使用 iproute2 的設定方式 * 先在 /etc/iptoute2/rt_tables 建立要採用的 table Exp. admin<file> # # reserved values # 255 local 254 main 253 default 0 unspec # # local # #1 inr.ruhep 1 admin </file>最後一行** 1 admin**就是新增加上去的部分 * 建立 ip route 的規則<code sh> ip route add 192.168.16.0/24 via 192.168.11.249 dev eth1 table admin </code> * 檢查建立規則<file> [root@pdc-e2160 iproute2]# ip route list table admin 192.168.16.0/24 via 192.168.11.249 dev eth1 </file> * 讓規則生效<code sh> ip rule add to 192.168.16.0/24 table admin </code> * 檢查目前生效規則<file> [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 </file> ==== 參考網址 ==== * http://centos.org/modules/newbb/viewtopic.php?topic_id=33541&forum=58 {{tag>centos6 tips}} tech/centos6_network.txt 上一次變更: 2011/10/12 09:34由 jonathan