To make my Ubuntu Server on more robust I have connected it to 2 ISP so that I can have redundant last mile. Also one of my ISP gives me unlimited bandwidth while the other is costlier but more reliable.
1.
To make your linux server multihomed, I am assuming that you have atleast 2 network interfaces. In my case both are ethernet (eth0 and eth1)
2.
Make sure both the networks are working individually up by setting it on /etc/network/interface
sudo vi /etc/network/interface
#Loopback
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.200.100
netmask 255.255.255.0
metric 100
gateway 192.168.200.6
auto eth1
iface eth1 inet static
address 192.168.201.100
netmask 255.255.255.0
metric 200
gateway 192.168.201.5
Now if you go to your terminal, you should be able to
>ip route show
192.168.201.0/24 dev eth1 proto kernel scope link src 192.168.201.100
192.168.200.0/24 dev eth0 proto kernel scope link src 192.168.200.100
default via 192.168.200.6 dev eth0 metric 100
default via 192.168.201.5 dev eth1 metric 200
With this if your eth0 goes down, your eth1 will take over and vice-versa.
But this is still a long way from making your network multihoned where your can do load balancing.
All you need to do is to add multihop route in your /etc/rc.local
ip route append default scope global nexthop via 192.168.200.6 dev eth0 weight 5 nexthop via 192.168.201.5 dev eth1 weight 1
No comments:
Post a Comment