adding second default gateway?

adding second default gateway?

Postby magfan » Mar 27th, '15, 23:35

How to permanently add a second default gateway? I thought about adding such a gateway with iproute2. But how to let the changes survive a reboot? Some of the networks on my Mageia system are happy with the default gateway. But one special network requires its own default gateway:

eth0, eth2-5 need the default gateway
eth1: IP 10.4.60.1, net 10.4.60.0/24 , mask 255.255.255.0, gateway 10.4.60.254
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: adding second default gateway?

Postby doktor5000 » Mar 28th, '15, 10:36

You might want to check /etc/sysconfig/network-scripts/ifup-routes

The routes would have to go in /etc/sysconfig/network-scripts/interfacename.route it seems.
Other route definitions seems can go into /etc/sysconfig/network-scripts/rule-interfacename from reading the script.

Some time ago some of the scripts also referenced /etc/sysconfig/static-routes but seems nowadays this is only the case for IPv6 (see /etc/sysconfig/network-scripts/ifup-ipv6 or /etc/sysconfig/network-scripts/ifup-sit)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: adding second default gateway?

Postby magfan » Mar 28th, '15, 10:48

Well, since /etc/sysconfig/network-scripts/route-interfacename did not work I will try /etc/sysconfig/network-scripts/interfacename.route. But how should the contents look like?
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron