Setting up the IBM AIX server as a router (static routing)

Routing is the process of moving a packet of data from source to destination. Static routing uses manually added routes whereas dynamic routing uses dynamic routes. This article explains how to set up an IBM® AIX® server as a router to communicate with private and public networks by using static routing.

Saiprasad P. Parkar (saiparkar@in.ibm.com), IT specialist, IBM

saiSaiprasad has been working as an AIX and Linux administrator for the past years with a strong background in storage, virtualization, and network.



Pravin S More (pravinmo@in.ibm.com), Associate IT Specialist, IBM

PravinPravin More has been working as a AIX and Linux administrator for the past four years. His work responsibilities include: Security administration, system and application management, and network administration.



25 April 2013

Also available in Chinese

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

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.

Example scenario

  • 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 - 9.3.129.14)
  • AIX clients on public network IP (public network IP - 9.3.129.20/21/22/23)
Figure 1. Example scenario
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 9.3.129.14 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:

#netstat -rn
Figure 2. VIOS routing table
VIOS routing table
Figure 3. Client routing table
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: 9.3.129.0

Gateway is the private network IP of the AIX server with IP forwarding on.

#route add -net 9.3.129.0 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: 9.3.129.14

#route add -net 192.168.10.0 9.3.129.14

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

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
Figure 4. Dynamic routing
Dynamic routing

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into AIX and Unix on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX
ArticleID=872853
ArticleTitle=Setting up the IBM AIX server as a router (static routing)
publish-date=04252013