Home > Articles > Networking > Routing & Switching

  • Print
  • + Share This

Sample Linux Router Setup

Keeping in mind all you have seen, consider a quick overview of a Linux router setup. I will show you a script that takes the setup illustrated in the beginning and turns on all the IPv4 traditional networking functions needed to perform traditional dynamic routing as you would see in countless small network connections.

So consider again the scenario. You have two networks, an Ethernet with IPv4 scope and a Token Ring with IPv4 scope The default router for the world as you know it is on the Token Ring. You are running RIPv1 and want to participate in the dynamic routing scheme. You need to create one single script that will take your Linux system and turn on IP routing, configure the system, and enable dynamic routing. Here it is:


# Turn on IPv4 packet forwarding

echo "1" > /proc/sys/net/ipv4/ip_forward

# We know our interfaces ...

/sbin/ifconfig eth0 netmask broadcast
/sbin/ifconfig tr0 netmask broadcast

# the above ifconfigs defined the routes also (2.2 kernel) so...

# default route

/sbin/route add default gw

# and enable RIP


exit 0

# Thats all folks....

Now this seems like a sneaky end to the chapter, but bear in mind the fundamental thought behind traditional IPv4 routing:

    All routing is a destination-driven process.

The rest of the chapter showed you how IPv4 is configured in the traditional manner and was intended as a quick refresher or overview. The rest of the book is concerned with the limitations of the traditional routing thought and the ways of Policy Routing.

Next Week: Chapter 2: Policy Routing Theory

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.