I want to configure my Linux so that it will be used as a network router (gateway). Can anybody give me some hints on this? (links are welcome!)
For a simple router, there are really only two steps that need to be done.
The first step is to enable routing in the kernel. By default, the kernel drops packets that it doesn't recognize; once you enable routing, it'll forward them. You need to issue either of these two commands when the computer boots:
Many distributions have a file called
For IPv6, the corresponding setting is
Set routing tables
The second step is to set routing tables. This can be simple or complicated depending on how much you need to do. For simple uses, configure each of your network interfaces' address and netmask, and add any needed extra route with the
Going beyond simple routing
If you need to rewrite packets, the basic command is
For complex setups, look at the
First plug in the IPs of the network for which you want to act as router. Either get multiple network interface cards or configure a virtual interface.