静态路由配置

Configuring Static Routes



Configure  terminal

interface  fastEthernet 0/0

Ip  address 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         注:这里可以跟出站的接口

Ip  route 192.168.34.0 255.255.255.0 192.168.23.3


Configuration :

R1:

interface  FastEthernet0/0

ip address 192.168.12.1 255.255.255.0

duplex auto

speed auto

ip route  192.168.23.0 255.255.255.0 192.168.12.2

ip route  192.168.34.0 255.255.255.0 192.168.23.3



R1#show ip route


Gateway of last  resort is not set


C    192.168.12.0/24 is directly connected,  FastEthernet0/0

S    192.168.23.0/24 [1/0] via 192.168.12.2

S    192.168.34.0/24 [1/0] via 192.168.23.3


R2:

interface  FastEthernet0/0

ip address 192.168.12.2 255.255.255.0

duplex auto

speed auto

!

interface  FastEthernet0/1

ip address 192.168.23.2 255.255.255.0

duplex auto

speed auto

ip route  192.168.34.0 255.255.255.0 192.168.23.3


R2#show ip route


Gateway of last  resort is not set


C    192.168.12.0/24 is directly connected,  FastEthernet0/0

C    192.168.23.0/24 is directly connected,  FastEthernet0/1

S    192.168.34.0/24 [1/0] via 192.168.23.3

R3:

interface  FastEthernet0/0

ip address 192.168.23.3 255.255.255.0

duplex auto

speed auto

!

interface  FastEthernet0/1

ip address 192.168.34.3 255.255.255.0

duplex auto

speed auto

!

ip route  192.168.12.0 255.255.255.0 192.168.23.2


R3#showip route


Gateway of last  resort is not set


S    192.168.12.0/24 [1/0] via 192.168.23.2

C    192.168.23.0/24 is directly connected,  FastEthernet0/0

C    192.168.34.0/24 is directly connected,  FastEthernet0/1

R4:

interface  FastEthernet0/0

ip address 192.168.34.4 255.255.255.0

duplex auto

speed auto

ip route  192.168.12.0 255.255.255.0 192.168.23.2

ip route  192.168.23.0 255.255.255.0 192.168.34.3


R4#show ip route


Gateway of last  resort is not set


S    192.168.12.0/24 [1/0] via 192.168.23.2

S    192.168.23.0/24 [1/0] via 192.168.34.3

C    192.168.34.0/24 is directly connected,  FastEthernet0/0


注:静态路由在路由表中是以“S”开头的

测试:

R1#ping  192.168.23.3 source 192.168.12.1 repeat 10


Type escape  sequence to abort.

Sending 10,  100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:

Packet sent with a  source address of 192.168.12.1

!!!!!!!!!!(能够正常回包)

Success rate is  100 percent (10/10), round-trip min/avg/max = 40/78/164 ms

R4#ping  192.168.12.1 source 192.168.34.4 repeat 10


Type escape  sequence to abort.

Sending 10,  100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:

Packet sent with a  source address of 192.168.34.4

!!!!!!!!!!

Success rate is  100 percent (10/10), round-trip min/avg/max = 40/103/148 ms

第三种配置(出站接口跟下一跳IP地址)之后路由表出现的路由

   23.0.0.0/24 is subnetted, 1 subnets

S       23.0.0.0  [1/0] via 12.12.12.2, FastEthernet0/0我们可以看出这个是用出站接口跟NEXT-HOP address 所表示出来的路由表的不同


你可能感兴趣的:(接口,gateway,interface,Speed,Address)