You are not logged in.

#1 2012-04-15 17:51:59

houmles
Member
Registered: 2011-09-22
Posts: 7

ipv4 from dhcp, ipv6 static on single interface eth0

Hi,

pls help me understand or solve my problem with my network setup.
I had ipv4 ip address assigned dynamically and ipv6 set statically, both via netcfg and everything worked without problem.

This is my netcfg config:

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='eth0'
IP='dhcp'
PRE_UP='ethtool -s eth0 wol g'
PRE_DOWN='ethtool -s eth0 wol g'

## for IPv6 autoconfiguration
#IP6='stateless'

## for DHCPv6
IP6='static'
ADDR6=(2002:54f2:xxxx:1::2/64)
GATEWAY6=2002:54f2:xxxx:1::1

But someday I received error when booting up and also when I try to start profile manualy:

/etc/rc.d/net-profiles start
:: eth0 up
RTNETLINK answers: File exists
Adding gateway 2002:54f2:xxxx:1::1 failed
No profile started.

I found that I can't have two gateways on one interface, but until now there's no problem.
When I disabled GATEWAY6 line from config, eth0 profile can be started but ipv6 connectivity didn't works.
I tried set ipv6 to stateless that works, but after some time not more that 5min network connection resets and after recovery in couple of seconds only ipv4 works.

Where's a problem? What can I do to achieve same setup I had before some update last week?
Thanks

Offline

#2 2012-04-16 00:34:58

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,226
Website

Re: ipv4 from dhcp, ipv6 static on single interface eth0

houmles wrote:

I found that I can't have two gateways on one interface, but until now there's no problem.

I suspect it's a problem with that; I've noticed this problem as well.

When trying to add multiple default gateways with iproute2 (ie, `ip r a default via xxx:xxx:xxx::xxxx`) it errors with the error you've mentioned. I'm not sure if this is a kernel bug, iproute2 bug, or not a bug at all.

Having multiple default IPv4 gateways works fine.

I believe netcfg doesn't check for an existing gateway and delete it first (or use `ip r r` instead or `ip r a`) before adding the one; but I haven't checked the code so I could be wrong.

EDIT:
OK, I couldn't resist looking at the code, and it indeed does a 'dumb' addition of the gateway:

112         if [[ -n "$GATEWAY" ]]; then
113             report_debug ethernet_iproute_up ip route add default via "$GATEWAY" dev "$INTERFACE"
114             if ! ip route add default via "$GATEWAY" dev "$INTERFACE"; then
115                 report_iproute "Adding gateway $GATEWAY failed"
116             fi
117         fi

I'm looking at making a patch now. Patch and bug report: https://bugs.archlinux.org/task/29480

Last edited by fukawi2 (2012-04-16 01:00:09)

Offline

#3 2012-04-16 15:41:02

diemuzi
Member
From: Pensacola, Florida
Registered: 2011-09-08
Posts: 10
Website

Re: ipv4 from dhcp, ipv6 static on single interface eth0

Thank you for that bug link, I just recently upgraded some of my boxes and ran into this problem with the gateway.


MSF RiderCoach at http://bikertraining.net

Offline

#4 2012-04-16 15:42:01

houmles
Member
Registered: 2011-09-22
Posts: 7

Re: ipv4 from dhcp, ipv6 static on single interface eth0

Nice find. I can confirm your patch works. Hope it gets to package soon smile

Offline

Board footer

Powered by FluxBB