-2

I have one LAN card. I've divided it to sub interfaces. Is there solution to have different working gateways on this interfaces? I want when PC cannot reach to destination using first gateway it should go through secondary gateway. I use Ubuntu 14.04. Here is my interface config :

auto eth0
iface eth0 inet static
address 10.0.0.25
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.88
dns-nameservers 8.8.8.8 8.8.4.4

#sub interface
auto eth0:1
iface eth0:1 inet static
address 10.0.0.26
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.99
APTN
  • 1

1 Answers1

0

You can do routes. The routes work as gateways but they only work in a season, if you shutdown your computer, the routes disappear. To do routes forever you need create a script with route comands and move to init.d:

sudo mv /home/usuar/script.sh /etc/init.d/

sudo chmod +x /etc/init.d/script.sh

sudo update-rc.d script.sh defaults

and to delete the sript

sudo update-rc.d -f script.sh remove

then remove the script

sudo rm /etc/init.d/script.sh

Community
  • 1
  • 1
Lombarda Arda
  • 268
  • 2
  • 12
  • The routes works at gateway, maybe the failure is in gateways, hardware, conexion... a conexion problem it may be for a thousand things. Try to isolate the problem – Lombarda Arda Mar 13 '15 at 08:41