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.TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop