Add and Remove Static Routes

A router is a logical component that forwards data packets between networks. A static route is a pre-determined pathway that a packet must travel to reach a specific host or network. Static routes provide more routing information to a router. It is added to the router’s routing table. A static route includes the destination CIDR and the next hop gateway IP address.

Samples

In this example: There are 2 geneve networks. Network geneve1 is added to RouterA as an interface, and its gateway is 192.168.187.1. Network geneve2 is added to RouterB as an interface, and its gateway is 192.168.188.1. Geneve1 is also added to RouterB, using 192.168.187.2 as the gateway IP address. Without any static routes, vm1 and vm2 are not connected. Vm1 can not ping to vm2 and vice versa. After adding the static route with 192.168.188.0/24 as destination CIDR and with 192.168.187.2 as the next hop gateway IP address, vm1 and vm2 are connected to each other. Vm1 can ping to vm2 successfully and vice versa.

*Figure 1 Add static routes to a router avatar

You can add or remove static routes for a router.

Add Static Routes

Follow these steps to add static routes:

  1. On the Networks page, click Routers(RHEL KVM Only) tab.

  2. Click the name of the router and go to the details of the router.

  3. Click Static Routes tab, then click Add Static Route button.

  4. In the Add Static Route dialog, complete the value for the following items:

    • Enter the Destination CIDR.

    • Enter the host information as Next Hop.

  5. Click Add button to save your changes.

Note: You need to remove all static routes added to the routers before removing this router.

Remove Static Routes

Follow these steps to remove static routes:

  1. On the Networks page, click Routers(RHEL KVM Only) tab.

  2. Click the name of the router and go to the details of the router.

  3. Click Static Routes tab, then click Remove Static Route button.

  4. In the opening dialog, click OK button to confirm a remove operation.

  5. Wait until the static route is removed from the window.