How to stop 2 default gateways? - Mandriva
This is a discussion on How to stop 2 default gateways? - Mandriva ; I have two network cards, one is on a 71.252.x network and one on a
192.168.x network. I would like my default gateway to be the 71.252.x
with only 192.168.x traffic going through that particualr card. When I
setup /etc/network-scripts/ifcfg-eth0 ...
-
How to stop 2 default gateways?
I have two network cards, one is on a 71.252.x network and one on a
192.168.x network. I would like my default gateway to be the 71.252.x
with only 192.168.x traffic going through that particualr card. When I
setup /etc/network-scripts/ifcfg-eth0 and eth1 then ifup I get two
0.0.0.0 gateways - How can I stop Mandriva doing that?
The device below should ONLY route to 192.168.168.254
[root@cartman network-scripts]# more ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.168.9
NETMASK=255.255.255.0
GATEWAY=192.168.168.254
ONBOOT=yes
METRIC=1
MII_NOT_SUPPORTED=no
USERCTL=no
DNS1=71.252.202.195
RESOLV_MODS=yes
IPV6INIT=no
IPV6TO4INIT=no
Everything else should route through this card
[root@cartman network-scripts]# more ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=71.252.202.195
NETMASK=255.255.255.0
GATEWAY=71.252.202.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=yes
USERCTL=no
DNS1=71.252.202.195
DNS2=4.2.2.2
RESOLV_MODS=yes
LINK_DETECTION_DELAY=6
IPV6INIT=no
IPV6TO4INIT=no
However there are two default routes.
[root@cartman network-scripts]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
71.252.202.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.168.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.168.254 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 71.252.202.1 0.0.0.0 UG 0 0 0 eth1
Any idea how I can fix this using the scripts or should I write my own
to start eth0 after eth1 if configured?
-
Re: How to stop 2 default gateways?
On Thu, 19 Jun 2008 02:50:02 GMT, nigel@sysadmininc.com wrote:
> I have two network cards, one is on a 71.252.x network and one on a
> 192.168.x network. I would like my default gateway to be the 71.252.x
> with only 192.168.x traffic going through that particualr card. When I
> setup /etc/network-scripts/ifcfg-eth0 and eth1 then ifup I get two
> 0.0.0.0 gateways - How can I stop Mandriva doing that?
>
> The device below should ONLY route to 192.168.168.254
> [root@cartman network-scripts]# more ifcfg-eth0
> DEVICE=eth0
> BOOTPROTO=static
> IPADDR=192.168.168.9
> NETMASK=255.255.255.0
> GATEWAY=192.168.168.254
Just remove the above line.
You may also want to add a zeroconf line to /etc/sysconfig/network
$ cat /etc/sysconfig/network
NETWORKING_IPV6=no
NOZEROCONF=yes <===== line to add.
NEEDHOSTNAME=no
NETWORKING=yes
HOSTNAME=wm81.home.test
-
Re: How to stop 2 default gateways?
Bit Twister wrote:
> You may also want to add a zeroconf line to /etc/sysconfig/network
Thanks, I'll give that a try.
-
Re: How to stop 2 default gateways?
On Wed, 18 Jun 2008 22:50:02 -0400, wrote:
> I have two network cards, one is on a 71.252.x network and one on a
> 192.168.x network. I would like my default gateway to be the 71.252.x
> with only 192.168.x traffic going through that particualr card. When I
> setup /etc/network-scripts/ifcfg-eth0 and eth1 then ifup I get two
> 0.0.0.0 gateways - How can I stop Mandriva doing that?
>
> The device below should ONLY route to 192.168.168.254
> [root@cartman network-scripts]# more ifcfg-eth0
> DEVICE=eth0
> BOOTPROTO=static
> IPADDR=192.168.168.9
> NETMASK=255.255.255.0
> GATEWAY=192.168.168.254
Try removing the above line.
Regards, Dave Hodgins
--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
-
Re: How to stop 2 default gateways?
David W. Hodgins wrote:
> > GATEWAY=192.168.168.254
> Try removing the above line.
My some odd freak of computing, whenever I traceroute a site it goes out
the 71.x network card and only 192.168.x does out that particular card.
Quite unexpected but works for me, not a proper solution tho.