Basic static route configuration example

The IP addresses and masks of the switches and hosts are displayed here. Static routes are required for interconnection between any two hosts.

Procedure
  1. Configure IP addresses for interfaces (details not shown).
  2. Configure static routes.
    1. Configure a default route on Switch A.
      <SwitchA> config terminal
      [SwitchA] ip route 0.0.0.0/0 1.1.4.2
    2. Configure two static routes on Switch B.
      <SwitchB> config terminal
      [SwitchB] ip route 1.1.2.0/24 1.1.4.1
      [SwitchB] ip route 1.1.3.0/24 1.1.5.6
    3. Configure a default route on Switch C.
      <SwitchC> system-view
      [SwitchC] ip route-static 0.0.0.0/0 1.1.5.5
  3. Configure the hosts. The default gateways for hosts A, B, and C are 1.1.2.3, 1.1.6.1, and 1.1.3.1. The configuration procedure is not shown.
  4. Display the configuration.
    1. Display the IP routing table of Switch A.
    2. Display the IP routing table of Switch B.
    3. Use the ping command on Host B to check the reachability of Host A, assuming Windows XP runs on the two hosts.
      C:\Documents and Settings\Administrator>ping 1.1.2.2
      Pinging 1.1.2.2 with 32 bytes of data:
      Reply from 1.1.2.2: bytes=32 time=1ms TTL=255
      Reply from 1.1.2.2: bytes=32 time=1ms TTL=255
      Reply from 1.1.2.2: bytes=32 time=1ms TTL=255
      Reply from 1.1.2.2: bytes=32 time=1ms TTL=255
      15
      Ping statistics for 1.1.2.2:
      Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
      Approximate round trip times in milli-seconds:
      Minimum = 1ms, Maximum = 1ms, Average = 1ms
    4. Use the tracert command on Host B to check the reachability of Host A.
      [HostB] tracert 1.1.2.2
      Tracing route to 1.1.2.2 over a maximum of 30 hops
      1 <1 ms <1 ms <1 ms 1.1.6.1
      2 <1 ms <1 ms <1 ms 1.1.4.1
      3 1 ms <1 ms <1 ms 1.1.2.2
      Trace complete.