Setting up the IBM AIX server as a router (static routing)
What is routing?
Routing is the process of moving a packet of data from source to destination. Routing is usually performed by a dedicated device called a router. Routing is a key feature of the Internet because it enables messages to pass from one computer to another and eventually reach the target computer. Each intermediary computer performs routing by passing along the message to the next computer. Part of this process involves analyzing a routing table to determine the best path.
Types of routing
There are two types of routing: Static routing and dynamic routing.
Static routing is the process of manually entering routes into a device's routing table through a configuration file that is loaded when the routing device starts up. As an alternative, these routes can be entered by a network administrator who configures the routes manually. Static routing is the simplest form of routing, but it is a manual process.
Static routing means that the location of the remote resource is specified at design time. Requests for a particular resource are always routed to the same region. Typically, when static routing is used, the location of the resource is specified in the installed resource definition.
- One Virtual I/O Server (VIOS) on a (private network IP - 192.168.10.101)
- One IBM AIX server with two network cards: One on private network, connected to VIOS and the other on public network. (private network IP - 192.168.10.32 and public network IP - 188.8.131.52)
- AIX clients on public network IP (public network IP - 184.108.40.206/21/22/23)
Figure 1. Example scenario
In this scenario, the clients on the public networkIP needs to be accessible from VIOS which is on the private network IP. The AIX server acts as the router, which can route all network packets from VIOS (private network) to clients (public network).
To set up an AIX server to be a router or gateway for the VIOS, we would have to basically add routes into it's routing table, and routes into the VIOS routing table, and the routing table of the external systems that want to communicate with the VIOS (so that an external system knows that it needs to send traffic to the 220.127.116.11 IP when trying to communicate with the 192.168.10.32 subnet).
To see the current routing table on your host, use the following command:
Figure 2. VIOS routing table
Figure 3. Client routing table
The first step is to enable IP forwarding on the AIX server that will be the router.
#no -o ipforwarding=1
Next, on the VIOS, we need to add a route for it to get to the external subnet 9.3.129.XXX.
Destination is public network: 18.104.22.168
Gateway is the private network IP of the AIX server with IP forwarding on.
#route add -net 22.214.171.124 192.168.10.32
Next, on one of the external systems (not the AIX server which is the router where IP forwarding is on), we need to make a route on how to get back to the VIOS:
Destination is the private network: 192.168.10.0
Gateway is the IP forwarding server's public network IP: 126.96.36.199
#route add -net 192.168.10.0 188.8.131.52
Now, the traffic flows as shown below:
VIOS -----> AIX with two network cards ----> AIX with only public IP first route IP forwarding on second route
Note: These changes will be flushed after reboot. To make it permanent, add the following line to /etc/rc.tcpip.
no -o ipforwarding=1
Advantages of static routing
- Minimal processor/memory overhead
- No bandwidth overhead (updates are not shared between routers)
- Granular control on how traffic is routed
Disadvantages of static routing
- Infrastructure changes must be manually adjusted
- No dynamic fault tolerance if a link goes down
- Impractical on large network
Dynamic routing protocols are supported by software applications running on the routing device (the router), which dynamically learn network destinations and how to get to them and also advertise those destinations to other routers. This advertisement function allows all the routers to learn about all the destination networks that exist and how to address those networks.
A router using dynamic routing will 'learn' the routes to all networks that are directly connected to the device. Next, the router will learn routes from other routers that run the same routing protocol (such as Routing Information Protocol (RIP), Routing Information Protocol 2 (RIP2), Enhanced Interior Gateway Routing Protocol (EIGRP), Open Shortest Path First (OSPF), Intermediate System to Intermediate System (IS-IS), Border Gateway Protocol (BGP), and so on). Each router will then sort through it's list of routes and select one or more 'best' routes for each network destination that the router knows or has learned.
Dynamic routing protocols then distributes this 'best route' information to other routers running the same routing protocol, thereby, extending the information on what networks exist and can be reached. This gives dynamic routing protocols the ability to adapt to logical network topology changes, equipment failures, or network outages 'on the fly'.
Dynamic routing protocols
A dynamic routing table is created, maintained, and updated by a routing protocol running on the router. Examples of routing protocols include RIP, EIGRP, and OSPF.
Advantages of dynamic routing
- Simpler to configure on larger networks
- Will dynamically choose a different (or better) route if a link goes down
- Ability to load balance between multiple links
Disadvantages of dynamic routing
- Updates are shared between routers, thus consuming bandwidth
- Routing protocols put additional load on router processor/RAM
- The choice of the "best route" is in the hands of the routing protocol, and not the network administrator