After you have configured all of your network devices you need to think about how your machine is going to route IP datagrams. If you have only one network device configured then your choice is easy, as all datagrams for any machine other than yours must go via that interface. If though you have more than one network interface then your choice is a little more complicated. You might for example have both an ethernet device and slip connection to your machine at home. In this situation you must direct all datagrams for your machine at home via your slip interface, and all else via the ethernet device. Routing is actually a very simple mechanism, but don't worry if you find it slightly difficult to understand at first, everybody does.
You can display the contents of your routing table by using the route command without any options.
There are three commonly used routing mechanisms for unix network configurations. I'll briefly discuss each in turn.
The default route mechanism is probably the most common and most useful to most end-user workstations and hosts on most networks. The default route is a route that matches every destination address, so that if there is no more specific route for a datagram to be sent to, then the default route will be used.
If you have a configuration where you have only a single ethernet interface, or a single slip interface device defined then you should point your default route via it. In the case of an ethernet interface, the Linux kernel knows where to send datagrams for any host on your network. It works this out using the network address and the network mask as discussed earlier. This means that the only datagrams the kernel won't know how to properly route will be those for people not on your network, to make this work you would normally have your default route point to your router address, as it is your means of getting outside of your local network. If you are using a slip connection, then your slip server will be acting as your router, so your default route will be vai your slip server.
To configure your default route, add thw following to your
rc.inet1
after all of your network device configurations:
#
# Add a default route.
#
/sbin/route add default gw RGA.RGA.RGA.RGA
#
Where:
RGA.RGA.RGA.RGA
represents your Route/Gateway Address.
This method is ugly, hazard prone and should be used with extreme care, some of you will want to use it anyway.
Those with the greatest need for proxy arp will be those of you who are configuring your Linux machine as a slip or PPP dial-in server.
Normally when a host on your ethernet network wants to talk to you, it knows your IP address, but doesn't know what hardware (ethernet) address to send datagrams to. The ARP mechanism is there specifically to provide that mapping function between network address and hardware address.
If you want to use your machine as a server for other machines, you must get your
machine to answer ARP requests for them on their behalf, as they will not be
physically connected to the ethernet network. Lets say that you have been
assigned a number of IP addresses on your local network that you will be
offering to dial-in slip/ppp users. Lets say those addresses are:
128.253.154.120-124
, and that you have an ethernet card with a
hardware address of 00:00:C0:AD:37:1C
. (You can find the
hardware address of your ethernet card by using the ifconfig
command with no options). To instruct your Linux server to answer arp requests
by proxy for these address you would need to add the following
commands to your rc.inet1
file:
#
# Proxy ARP for those dialin users who will be using this
# machine as a server:
#
/sbin/arp -s 128.263.154.120 00:00:C0:AD:37:1C pub
/sbin/arp -s 128.263.154.121 00:00:C0:AD:37:1C pub
/sbin/arp -s 128.263.154.122 00:00:C0:AD:37:1C pub
/sbin/arp -s 128.263.154.123 00:00:C0:AD:37:1C pub
/sbin/arp -s 128.263.154.124 00:00:C0:AD:37:1C pub
#
# End proxy arps.
The pub
argument stands for `publish', it is this that
instructs your machine to answer requests for these addresses, even though
they are not for your machine, when it answers it will supply the hardware
address specified, which is of course its own hardware address.
Naturally you will need to ensure that you have routes configured in your linux server that point these addresses to the slip device on which they will be connecting.
gated could be used in place of proxy arp and would certainly be much cleaner, but its primary use is if you want your linux machine to act as an ip router. It is an implentation of the rip protocol. rip stands for `Routing Information Protocol'. If you run gated, your linux machine will periodically broadcast a copy of it routing table to your network in a special format. In this way, all of the other machines on your network will know what addresses are accesible via your machine.
gated would normally be started from your rc.inet2
which
is covered in the next section.
There are a couple of gated distributions floating around, and I don't have details of any of them at the moment. I'll try and get some more information into the next version.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter