Static Routing Configuration 1
Set PC machine ip, gateway , open interfaces , static routing (target segment + subnet mask + next hop address)
To Router1 A Case Study
Router>
Router>enable
Router#configure terminal
Router(config)#int f0/0
Router(config-if)#ip address 192.168.1.3 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int f0/1
Router (config-IF) #ip address 192.168.2.1 255.255.255.0 (two interfaces provided ip address)
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2
Router (config) #ip 255.255.255.0 route 192.168.4.0 192.168.2.2 (next hops to reach 3.0 and 4.0 network segment)
Router(config)#
Similarly two other routers
In this topology, all three router as the default route, the intermediate position is set to a static route setting static routing or two sides.
Set the default routing method
Router (config) #ip route0.0.0.0 0.0.0.0 next-hop address
Router#show ip route
Static Routing Configuration 2
Set PC machine ip, gateway , set the router 's ip and open its interface , static routing (target segment + subnet mask + next hop address), and the default route ( 0.0.0.0 0.0.0.0 next-hop address)
1 , . 4 No. router set to default route ( default route )
2 , 3 Hao router is set to static route ( static route )
. 1 No. router setting process
Router>
Router>enable
Router#configure terminal
Router(config)#int f0/0
Router(config-if)#ip address 192.168.1.3 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#int f0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#ip route 0.0.0.0.0 0.0.0.0 192.168.2.2
Router(config)#
. 4 No. router analogy . 1 No.
. 3 No. router set as follows
Router> and
Router#configure terminal
Router(config)#int f0/0
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int f0/1
Router(config-if)#ip address 192.168.4.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.4.2
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
Router(config)#exit
Router#
Router#show ip route
Gateway of last resort is not set
S 192.168.1.0/24 [1/0] via 192.168.3.1
S 192.168.2.0/24 [1/0] via 192.168.3.1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
C 192.168.4.0/24 is directly connected, FastEthernet0/1 (直连)
192.168.5.0/24 S [1/0] Via 192.168.4.2 (static)
2 No. router provided analogy . 3 No.