Static route configuration instance

Source: Internet
Author: User

Static route configuration instance
Static Routing: first, configure the basic configuration of R1 R2 R3 and configure a reasonable IP address for the corresponding interface. The two routers connected to the same root network must have the same network bit. Different host bit because they are different devices in the same network. R1 configuration: Router> enable Router # config ter Router (config) # line console 0 Router (config-line) # exec-timeout 0 0 Router (config-line) # logging synchronous Router (config-line) # exit Router (config) # no ip domain-lookup Router (config) # ho R1 R1 (config) # interface loopback 0R1 (config-if) # ip address 1.1.1.1 255.255.255.255R1 (config-if) # no shutdown R1 (config-if) # exit R1 (config) # interface loopback 1R1 (config-if) # ip adsid Ss 1.1.2.1 restart 255.255r1 (config-if) # no shutdown R1 (config-if) # exit R1 (config) # interface loopback 2R1 (config-if) # ip address 1.1.3.1 255.255.255.255R1 (config-if) # no shutdown R1 (config-if) # exit R1 (config) # interface loopback 3R1 (config-if) # ip address 1.1.4.1 255.255.255.255R1 (config-if) # no shutdown R1 (config-if) # exit R1 (config) # interface f0/0R1 (config-if) # ip address 12.1.1.1 255.255.255.0R1 (config -If) # no shutdown R1 (config-if) # exit R2 configuration: Router> enable Router # config terminal Router (config) # line console 0 Router (config-line) # exec-timeout 0 0 Router (config-line) # logging synchronous Router (config-line) # exit Router (config) # no ip domain-lookup Router (config) # ho R2 R2 (config) # interface f0/0R2 (config-if) # ip address 12.1.1.2 255.255.255.0R2 (config-if) # no shutdown R2 (config-if) # exit R2 (config) # interfa Ce f0/1R2 (config-if) # ip address 23.1.1.2 255.255.0r2 (config-if) # no shutdown R2 (config-if) # exit R2 (config) # interface loopback 0R2 (config-if) # ip address 2.2.2.2 255.255.255.255R2 (config-if) # no shutdown R2 (config-if) # exit R3 Configuration: router> enable Router # config terminal Router (config) # line console 0 Router (config-line) # exec-timeout 0 0 Router (config-line) # logging synchronous Router (config-line) # exit Route R (config) # no ip domain-lookup Router (config) # ho R3 R3 (config) # interface f0/1R3 (config-if) # ip address 23.1.1.3 255.255.255.0R3 (config-if) # no shutdown R3 (config-if) # exit R3 (config) # interface lo0R3 (config-if) # ip address 3.3.3.3 255.255.255.255R3 (config-if) # no shutdown R3 (config-if) # exit and configure Static Routing on R1 R2 R3, after a router interface is configured with an IP address, a route to the changed network is generated for the router. This is what we call the direct connection path. Therefore, we only need to configure the path to the other (non-direct connection) network in the network. R1 configuration: For R1, the direct connection is the C-Marked route in the routing table, while 2.2.2.2/32, 3.3.3.3/32, 23.1.1.0/24 are not found in the router tables of these routers (these are non-direct connection paths). Therefore, you need to configure these routes. r1 # sho ip route Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP D-VPN, EX-VPN 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, e-EGP I-IS, L1-IS level-1, L2-IS level-2, ia-IS inter area *-candidate default, u-per-user static route, o-odr p-periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 4 subnetsC 1.1.1.1 is directly connected, when 1.1.2.1 is directly connected, then 1.1.3.1 is directly connected, Loopback2C 1.1.4.1 is directly connected, 255.12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, FastEthernet0/zookeeper R1 (config) # ip route 3.3.3.3 255.255.255.255 12.1.1.2 who can help me forward data to the destination --- next hop address R1 (config) # ip route 23.1.1.0 255.255.255.0 12.1.1.2spacer.gifR1 (config) # ip route 2.2.2.2 route 255.255.255 f0/0 to go there, from which interface the data is sent-output interface R2 Configuration: for R2, only 1.1.1.1 ----- 1.1.2.1 ---- 1.1.3.1 ---- 1.1.4.1 and 3.3.3.3 are not directly connected (non-directly connected). Therefore, you only need to write a static route for these network segments, for the four paths 1.1.1.1 ---- 1.1.4.1, you can use a general method to match the four commands with one command. --- make a summary. at the same time, note that during the summary, it is possible to summarize non-existent network segments such as 1.1.5.1. Therefore, note that on R1 (the summary 1.1.1.1-1.1.4.1 should be the path on R1) deploy a black hole route. r2 (config) # ip route 1.1.0.0 255.255.248.0 12.1.1.1R2 (config) # ip route 3.3.3.3 255.255.255.255 23.1.1.3 R1 configuration: R1 (config) # ip route 1.1.0.0 255.255.248.0 null 0 R3 Configuration: on R3, we can consider the network endpoint on R3. Therefore, for R3, any point on the network can be matched by the default route. r3 (config) # ip route 0.0.0.0 0.0.0.0 23.1.1.2 check the route table to see if all the paths are complete. r1 R2 R3 must have a path to 1.1.1.1-1.1.2.1 --- 1.1.3.1 --- 1.1.4.1 and 12.1.1.0/24; 23.1.1.0/24; 2.2.2.2/32; 3.3.3.3/32. r1 configuration: R1 # sho ip route Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP D-VPN, EX-OSPF 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, E-EGP I-IS, L1-IS level-1, L2-IS level-2, ia-IS inter area *-candidate default, U-per-user static route, o-odr p-periodic downloaded static route Gateway of last resort is not set 1.0.0.0/8 is variably subnetted, 5 subnets, 2 masksS 1.1.0.0/21 is directly connected, when 1.1.1.1/32 is directly connected, then 1.1.2.1/32 is directly connected, Loopback1C 1.1.3.1/32 is directly connected, Loopback2C 1.1.4.1/32 is directly connected, Loopback3 2.0.0.0/32 is subnetted, 1 subnetsS 2.2.2.2 is directly connected, FastEthernet0/0 3.0.0.0/32 is subnetted, 1 subnetsS 3.3.3.3 [1/0] via 12.1.1.2 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, fastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnetsS 23.1.1.0 [1/0] via 12.1.1.2 R2 configuration: R2 # sho ip route Codes: C-connected, S-static, I-IGRP, r-RIP, M-mobile, B-BGP D-VPN, EX-OSPF 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, E-EGP I-IS, L1-IS level-1, l2-IS level-2, ia-IS inter area *-candidate default, U-per-user static route, o-odr p-periodic downloaded static route Gateway of last resort is not set 1.0.0.0/21 is subnetted, 1 subnetsS 1.1.0.0 [1/0] via 12.1.1.1 2.0.0.0/32 is subnetted, 1 subnetsC 2.2.2.2 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnetsS 3.3.3.3 [1/0] via 23.1.1.3 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, fastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/1 R3 configuration: R3 # sho ip rouCodes: C-connected, S-static, I-IGRP, r-RIP, M-mobile, B-BGP D-VPN, EX-OSPF 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, E-EGP I-IS, L1-IS level-1, l2-IS level-2, ia-IS inter area *-candidate default, U-per-user static route, o-odr p-periodic downloaded static route Gateway of last resort is 23.1.1.2 to network 0.0.0.0 3.0.0.0/32 is subnetted, 1 subnetsC 3.3.3.3 is directly connected, Loopback0 23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/1 S * 0.0.0.0/0 [1/0] via 23.1.1.2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.