Cisco配置静态路由

描述

实验拓扑

静态路由

配置R1

 


Router(config)




R1(config)
R1(config-if)
R1(config-if)




R1(config-if)
R1(config-if)
R1(config-if)




R1(config)
R1(config)

 

查看接口ip

 


R1
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.1    YES manual up                    up      
Ethernet0/1                192.168.1.254   YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down 

 

查看R1路由表

 


R1
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR


Gateway of last resort is not set


      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Ethernet0/1
L        192.168.1.254/32 is directly connected, Ethernet0/1
S     192.168.3.0/24 [1/0] via 192.168.12.2
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.1/32 is directly connected, Ethernet0/0
S     192.168.23.0/24 [1/0] via 192.168.12.2

 

配置R2

 


Router>enable
Router
Router(config)




R2(config)
R2(config-if)
R2(config-if)




R2(config-if)
R2(config-if)
R2(config-if)




R2(config)
R2(config)

 

查看接口ip

 


R2
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.2    YES manual up                    up      
Ethernet0/1                192.168.23.2    YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down

 

查看路由

 


R2
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR


Gateway of last resort is not set


S     192.168.1.0/24 [1/0] via 192.168.12.1
S     192.168.3.0/24 [1/0] via 192.168.23.3
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.2/32 is directly connected, Ethernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/1
L        192.168.23.2/32 is directly connected, Ethernet0/1

 

配置R3

 


Router>enable 
Router
Router(config)
R3(config)


R3(config)
R3(config-if)
R3(config-if)


R3(config-if)
R3(config-if)
R3(config-if)


R3(config)
R3(config)

 

查看接口ip

 


R3
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.23.3    YES manual up                    up      
Ethernet0/1                192.168.3.254   YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down   

 

查看路由

 


R3
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR


Gateway of last resort is not set


S     192.168.1.0/24 [1/0] via 192.168.23.2
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, Ethernet0/1
L        192.168.3.254/32 is directly connected, Ethernet0/1
S     192.168.12.0/24 [1/0] via 192.168.23.2
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/0
L        192.168.23.3/32 is directly connected, Ethernet0/0

 

配置vpc4

 


VPCS> ip 192.168.1.2/24 192.168.1.254
Checking for duplicate address...
VPCS : 192.168.1.2 255.255.255.0 gateway 192.168.1.254

 

配置vpc5

 


VPCS> ip 192.168.3.2/24 192.168.3.254
Checking for duplicate address...
VPCS : 192.168.3.2 255.255.255.0 gateway 192.168.3.254

 

在vpc4上ping vpc5测试连通性

 


VPCS> ping 192.168.3.2


84 bytes from 192.168.3.2 icmp_seq=1 ttl=61 time=0.958 ms
84 bytes from 192.168.3.2 icmp_seq=2 ttl=61 time=0.785 ms
84 bytes from 192.168.3.2 icmp_seq=3 ttl=61 time=1.050 ms
84 bytes from 192.168.3.2 icmp_seq=4 ttl=61 time=0.823 ms
84 bytes from 192.168.3.2 icmp_seq=5 ttl=61 time=0.827 ms

 

  审核编辑:汤梓红

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分