redhat5 5 靜態路由表實驗

2021-06-04 14:54:15 字數 884 閱讀 7075

準備工作

準備三颱linux虛擬機器,採用bridged 的連線方式.一台當路由器c(配置兩塊網絡卡eth0,eth1),兩台當測試機a,b(網絡卡分別為eth0)。

配置ip

1】 測試機a的eth0網絡卡

ip:10.10.22.5 netmask 255.255.255.0  gateway: 10.10.22.1

2】 測試機b的eth0網絡卡

ip:10.10.33.5 netmask 255.255.255.0  gateway: 10.10.33.1

3】 路由器c的eth0網絡卡

ip:10.10.22.1 netmask 255.255.255.0  gateway: 10.10.22.1

4】 路由器c的eth1網絡卡

ip:10.10.33.1 netmask 255.255.255.0  gateway: 10.10.33.1

開啟網絡卡c的ip**功能

echo "1" > /proc/sys/net/ipv4/ip_forward

配置檔案 /etcsysctl.conf

net.ipv4.ip_forward = 1

給路由器c配置靜態路由表

1】增加靜態路由條目

route add -net 10.10.22.0/24 gw 10.10.22.1 dev eth0

route add -net 10.10.23.0/24 gw 10.10.23.1 dev eth1

這時 a b 可以互相ping通

2】刪除靜態路由條目

route del -net 10.10.22.0/24 gw 10.10.22.1 dev eth0

3】靜態路由存放在/etc/sysconfig/static-routes 目錄下

靜態路由表

路由器用的是普通家用的1wan 4lan,靜態路由表作用,靜態路由表怎們設定,能不能通過靜態路由表設定不同網段共享資料夾?靜態路由表通常是指手動增加的路由表,根據閘道器連線的網段進行設定 通常家用路由器只有乙個網段,如192.168.0段,那麼預設靜態路由表就是0.0.0.0 192.168.0.x...

路由表 靜態路由 RIP

1 路由表的內容 destination mask 目標網段 proto 路由 標誌 分為三大類 鏈路層自發現 靜態 動態 direct 直連 static 靜態 人工寫入的路由 rip ospf isis bgp 動態路由 一種自動計算出來的路由 pre 路由優先順序 路由表對於相同字首不同 的路...

(4)配置路由器的路由表(靜態)

r1路由表的構造 選擇r1路由器,在cli視窗中輸入 router config ip route 192.168.3.0 255.255.255.0 192.168.2.2 router config ip route 192.168.3.0 255.255.255.0 192.168.6.1 1...