Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Multiple default gateways
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
paully
n00b
n00b


Joined: 21 May 2004
Posts: 47
Location: Folkestone, Kent, UK

PostPosted: Sat Aug 13, 2011 9:08 am    Post subject: Multiple default gateways Reply with quote

Hi Folks

Since upgrading to baselayout-2, I now have multiple default gateways in my routing table, on a single wired ethernet connection...

Code:
thinkpad ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.0.200   0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.0.200   0.0.0.0         UG    2      0        0 eth0
0.0.0.0         192.168.0.200   0.0.0.0         UG    202    0        0 eth0


Sure, I can zap the extra ones...

Code:
thinkpad ~ # route del default netmask 0.0.0.0 metric 202 dev eth0
thinkpad ~ # route del default netmask 0.0.0.0 metric 2 dev eth0


...to leave me with what I had before baselayout2...

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.0.200   0.0.0.0         UG    0      0        0 eth0


...but why I have I got these in the first place?!

Here is my /etc/conf.d/net which is using DHCP...

Code:
dhcpcd_eth0="-t 5"


...and this occurs on any network I join, work or friends.

Thanks.

Paully
_________________
PAULLY
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sat Aug 13, 2011 9:34 am    Post subject: Reply with quote

Hi,

could you post your /etc/conf.d/net file ?

I think you might have something like : routes_eth0="default gw 192.168.0.200..etc"
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
paully
n00b
n00b


Joined: 21 May 2004
Posts: 47
Location: Folkestone, Kent, UK

PostPosted: Sat Aug 13, 2011 10:08 am    Post subject: Reply with quote

Code:
thinkpad ~ # cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
dhcpcd_eth0="-t 5"

_________________
PAULLY
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6802
Location: Blighty

PostPosted: Mon Aug 15, 2011 1:59 pm    Post subject: Reply with quote

What version of dhcpcd are you using?

Can you post output of the following?
dhcpcd -x
dhcpcd -dB

You can CTRL-C the dhcpcd process once you've colleted the data and just restart it with
dhcpcd
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
paully
n00b
n00b


Joined: 21 May 2004
Posts: 47
Location: Folkestone, Kent, UK

PostPosted: Wed Aug 17, 2011 10:51 am    Post subject: Reply with quote

UberLord wrote:
What version of dhcpcd are you using?

Code:
thinkpad ~ # eix -I dhcp
[I] net-misc/dhcpcd
     Available versions:  5.2.12 ~5.2.12-r1 {elibc_glibc +zeroconf}
     Installed versions:  5.2.12(17:57:10 29/06/11)(elibc_glibc zeroconf)
     Homepage:            http://roy.marples.name/projects/dhcpcd/
     Description:         A fully featured, yet light weight RFC2131 compliant DHCP client


Can you post output of the following?
dhcpcd -x

Code:
thinkpad ~ # dhcpcd -x
dhcpcd[3256]: dhcpcd not running


dhcpcd -dB

Code:
thinkpad ~ # dhcpcd -dB
dhcpcd[3257]: version 5.2.12 starting
dhcpcd[3257]: eth0: using hwaddr e8:9a:8f:4f:d4:79
dhcpcd[3257]: eth0: executing `/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[3257]: eth0: executing `/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[3257]: wlan0: using hwaddr 8c:a9:82:92:52:6a
dhcpcd[3257]: wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[3257]: wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks', reason NOCARRIER
dhcpcd[3257]: eth0: reading lease `/var/lib/dhcpcd/dhcpcd-eth0.lease'
dhcpcd[3257]: eth0: rebinding lease of 192.168.1.210
dhcpcd[3257]: eth0: sending REQUEST (xid 0x9e36454f), next in 4.66 seconds
dhcpcd[3257]: wlan0: waiting for carrier
dhcpcd[3257]: eth0: acknowledged 192.168.1.210 from 192.168.1.250
dhcpcd[3257]: eth0: checking for 192.168.1.210
dhcpcd[3257]: eth0: sending ARP probe (1 of 3), next in 1.25 seconds
dhcpcd[3257]: eth0: sending ARP probe (2 of 3), next in 1.33 seconds
dhcpcd[3257]: eth0: sending ARP probe (3 of 3), next in 2.00 seconds
dhcpcd[3257]: eth0: leased 192.168.1.210 for 3600 seconds
dhcpcd[3257]: eth0: adding IP address 192.168.1.210/24
dhcpcd[3257]: eth0: adding route to 192.168.1.0/24
dhcpcd[3257]: eth0: adding default route via 192.168.1.1
dhcpcd[3257]: eth0: writing lease `/var/lib/dhcpcd/dhcpcd-eth0.lease'
dhcpcd[3257]: eth0: executing `/lib/dhcpcd/dhcpcd-run-hooks', reason BOUND
dhcpcd[3257]: eth0: sending ARP announce (1 of 2), next in 2.00 seconds
dhcpcd[3257]: eth0: sending ARP announce (2 of 2)


You can CTRL-C the dhcpcd process once you've colleted the data and just restart it with
dhcpcd


OK...

Code:
thinkpad ~ # dhcpcd
dhcpcd[3379]: version 5.2.12 starting
dhcpcd[3379]: eth0: rebinding lease of 192.168.1.210
dhcpcd[3379]: wlan0: waiting for carrier
dhcpcd[3379]: eth0: acknowledged 192.168.1.210 from 192.168.1.250
dhcpcd[3379]: eth0: checking for 192.168.1.210
dhcpcd[3379]: eth0: leased 192.168.1.210 for 3600 seconds
dhcpcd[3379]: forked to background, child pid 3442


My routing table now reads...

Code:
thinkpad ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    202    0        0 eth0


...which is correct and without the extra default gateways. So, what do I need to do?

I notice there is version ~5.2.12-r1 which I could unmask and try?

Thanks UberLord.
_________________
PAULLY
Back to top
View user's profile Send private message
Dagger
Retired Dev
Retired Dev


Joined: 11 Jun 2003
Posts: 765
Location: UK

PostPosted: Wed Aug 17, 2011 12:56 pm    Post subject: Reply with quote

Do you have both /etc/init.d/net.eth0 AND /etc/init.d/network running?
_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
paully
n00b
n00b


Joined: 21 May 2004
Posts: 47
Location: Folkestone, Kent, UK

PostPosted: Wed Aug 17, 2011 1:53 pm    Post subject: Reply with quote

No, just /etc/init.d/net.eth0 (and /etc/init.d/net.lo) in the boot runlevel.
_________________
PAULLY
Back to top
View user's profile Send private message
paully
n00b
n00b


Joined: 21 May 2004
Posts: 47
Location: Folkestone, Kent, UK

PostPosted: Tue Aug 23, 2011 9:39 am    Post subject: Reply with quote

Well, I have removed net.eth0 from the boot runlevel and added network instead.

It has not made any difference to the multiple default gateways.

Here is the routing for my wireless connection:-

Code:
thinkpad ~ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         192.168.0.1     0.0.0.0         UG    304    0        0 wlan0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
127.0.0.0       -               255.0.0.0       !     0      -        0 -
192.168.0.0     0.0.0.0         255.255.255.0   U     2      0        0 wlan0


It all works, but can anyone explain why we have this now? Seriously, is there no-one?

:?
_________________
PAULLY
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Sat Aug 27, 2011 7:20 am    Post subject: Reply with quote

does
Code:
egrep -R ' (via|gw) ' /etc/runlevels/*
yield any insights?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum