qder 发表于 2013-8-15 08:41:38

静态路由配置



Configureterminal
interfacefastEthernet 0/0
Ipaddress 192.168.12.1 255.255.255.0
No shut
Exit
Ip route 192.168.23.0 255.255.255.0 192.168.12.2         注:这里可以跟出站的接口
Iproute 192.168.34.0 255.255.255.0 192.168.23.3



Configuration :
R1:interfaceFastEthernet0/0ip address 192.168.12.1 255.255.255.0duplex autospeed autoip route192.168.23.0 255.255.255.0 192.168.12.2ip route192.168.34.0 255.255.255.0 192.168.23.3

R1#show ip route
Gateway of lastresort is not set
C    192.168.12.0/24 is directly connected,FastEthernet0/0S    192.168.23.0/24 via 192.168.12.2S    192.168.34.0/24 via 192.168.23.3
R2:interfaceFastEthernet0/0ip address 192.168.12.2 255.255.255.0duplex autospeed auto!interfaceFastEthernet0/1ip address 192.168.23.2 255.255.255.0duplex autospeed autoip route192.168.34.0 255.255.255.0 192.168.23.3
R2#show ip route
Gateway of lastresort is not set
C    192.168.12.0/24 is directly connected,FastEthernet0/0C    192.168.23.0/24 is directly connected,FastEthernet0/1S    192.168.34.0/24 via 192.168.23.3
R3:interfaceFastEthernet0/0ip address 192.168.23.3 255.255.255.0duplex autospeed auto!interfaceFastEthernet0/1ip address 192.168.34.3 255.255.255.0duplex autospeed auto!ip route192.168.12.0 255.255.255.0 192.168.23.2
R3#showip route
Gateway of lastresort is not set
S    192.168.12.0/24 via 192.168.23.2C    192.168.23.0/24 is directly connected,FastEthernet0/0C    192.168.34.0/24 is directly connected,FastEthernet0/1R4:interfaceFastEthernet0/0ip address 192.168.34.4 255.255.255.0duplex autospeed autoip route192.168.12.0 255.255.255.0 192.168.23.2ip route192.168.23.0 255.255.255.0 192.168.34.3
R4#show ip route
Gateway of lastresort is not set
S    192.168.12.0/24 via 192.168.23.2S    192.168.23.0/24 via 192.168.34.3C    192.168.34.0/24 is directly connected,FastEthernet0/0
注:静态路由在路由表中是以“S”开头的

测试:
R1#ping192.168.23.3 source 192.168.12.1 repeat 10
Type escapesequence to abort.Sending 10,100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:Packet sent with asource address of 192.168.12.1!!!!!!!!!!(能够正常回包)Success rate is100 percent (10/10), round-trip min/avg/max = 40/78/164 ms
R4#ping192.168.12.1 source 192.168.34.4 repeat 10
Type escapesequence to abort.Sending 10,100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:Packet sent with asource address of 192.168.34.4!!!!!!!!!!Success rate is100 percent (10/10), round-trip min/avg/max = 40/103/148 ms

第三种配置(出站接口跟下一跳IP地址)之后路由表出现的路由
   23.0.0.0/24 is subnetted, 1 subnetsS       23.0.0.0 via 12.12.12.2, FastEthernet0/0我们可以看出这个是用出站接口跟NEXT-HOP address 所表示出来的路由表的不同


ph033378 发表于 2013-8-16 09:23:41

沙发!沙发!

mm111222 发表于 2013-8-18 00:16:29

走过了年少,脚起了水泡

megnlingling 发表于 2013-8-19 10:44:06

禽兽尚且有半点怜悯之心,而我一点也没有,所以我不是禽兽。

hc6538 发表于 2013-8-23 22:55:57

生我之前谁是我,生我之后我是谁?

q2009a06z22 发表于 2013-8-26 05:44:19

商女不知亡国恨、妓女不懂婚外情。

xy123321 发表于 2013-8-29 08:05:57

走自己的路,让别人打车去吧。
页: [1]
查看完整版本: 静态路由配置