Following tip is submitted by Raj.
If you have 2 NIC (network Lan card) each connected to different networks:
=> eth0: 192.168.1.0/24
=> eth1: 192.168.2.0/24
Consider above setup. Now if you want to route traffic to connected network only (eth0 and eth1) w/o setting Linux server as a router. This is generally called multi homing setup. You don’t have to setup Linux box as a router to use multi homing :). Just assign as IP address to each NIC and you are done.
How do I configure Linux multi homing?
Just assign each interface IP address using ifconfig or use DHCP and multi homing will be turned on:
# ifconfig eth0 192.168.1.254 up
# ifconfig eth1 192.168.2.254 up
Commonly, most admin confuse the idea of multi-homing with the concept of routing or IP forwarding. Once two IP address assigned your system follows the default. No special configuration needed. Your multi-homing is up and running :).
You can turn on additional routing feature, with multi-homing. Just enable forwarding:
# echo 1 > /proc/sys/net/ipv4/ip_forwarding
If you reboot system you will lost additional routing setup. Add following line to your /etc/sysctl.conf file:
# vi /etc/sysctl.conf Add following line:
net.ipv4.ip_forward = 1
Save and type command:
# sysctl -p
But, what is the difference between routing and multi homing setup?
=> Multi homing route traffic to each connected network but no frames are forwarded between two networks.
=> Routing forward frames between two networks. See these (setup Linux as a router for DSL, T1 line etc) previous articles (setup vmware host router) on how to setup Linux as a router.
Updated for accuracy by nixCraft.