Introduction Static routes are manually configured so that the packets can be sent to the specified destination network go through the specified route. Static routes can be very important if the switch don't support dynamic routing protocol(RIP,OSPF etc.) and are useful for specifying a gateway of last resort to which all unroutable packets are sent. Case of configuration a) Requirement Configure the switch with static routes and ensure that users in network 1 can communicate with users in network 2 b) Network Topology c) Configuration Tips 1) Assign IP addresses to SW1 and SW2 2) Configure Static Routes on SW1 3) Configure Static Routes on SW2 4) Save Configuration d) Configuration Steps 1) Assign IP address to SW1 Ruijie>enableRuijie#configure terminalRuijie(config)#interface fastethernet 0/1Ruijie(config-if-FastEthernet 0/1)#no switchportRuijie(config-if-FastEthernet 0/1)#ip address 192.168.1.254 255.255.255.0Ruijie(config-if-FastEthernet 0/1)#interface GigabitEthernet 0/25Ruijie(config-if-GigabitEthernet 0/25)#no switchportRuijie(config-if-GigabitEthernet 0/25)#ip address 192.168.3.1 255.255.255.0Ruijie(config-if-GigabitEthernet 0/25)#exit 2) Assign IP address to SW2 Ruijie>enableRuijie#configure terminalRuijie(config)#interface fastethernet 0/1Ruijie(config-if-FastEthernet 0/1)#no switchportRuijie(config-if-FastEthernet 0/1)#ip address 192.168.2.254 255.255.255.0Ruijie(config-if-FastEthernet 0/1)#interface GigabitEthernet 0/25Ruijie(config-if-GigabitEthernet 0/25)#no switchportRuijie(config-if-GigabitEthernet 0/25)#ip address 192.168.3.2 255.255.255.0Ruijie(config-if-GigabitEthernet 0/25)#exit 3) Configure Static Routes on SW1 Ruijie(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2 //configure static routes to destination subnet 192.168.2.0/24 and next hop is 192.168.3.2Note: 1) When you configure static routes, there're two ways to specify next hop. You can specify an IP address ,or you can specify a local outgoing interface. 2) We suggest you to use IP address as next hop 4) Configure Static Routes on SW2 Ruijie(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1 //configure static routes to destination subnet 192.168.1.0/24 and next hop is 192.168.3.1 5) Save configuration Ruijie(config)#endRuijie#write Verification You can use "ping" on a station in network 1 to verify network connectivity "run"-->"cmd"-->"ping x.x.x.x" (x.x.x.x is a host in network 2) How to display ip routing table Ruijie#show ip route Codes: C - connected, S - static, R - RIP, B - BGP 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 Gateway of last resort is no set S 192.168.2.0/24 [1/0] via 192.168.3.2 C 192.168.3.0/24 is directly connected, GigabitEthernet 0/25 C 192.168.3.1/32 is local host. C 192.168.1.0/24 is directly connected, FastEthernet 0/1 C 192.168.1.254/32 is local host. |