2

Hi i'm trying to spin up VMs on public ipv6 address's.

When I enable net.ipv6.conf.all.forwarding = 1 on the host it seems to kill the ipv6 connectivity

root@li166-218:~# ip -6 route show dev eth0
2600:3c01::/64  proto kernel  metric 256  expires 2591994sec
fe80::/64  proto kernel  metric 256
default via fe80::1  proto ra  metric 1024  expires 84sec
root@li166-218:~# traceroute -6 google.com
traceroute to google.com (2607:f8b0:4010:801::1000), 30 hops max, 80 byte packets
 1  2600:3c01::8678:acff:fe0d:79c1 (2600:3c01::8678:acff:fe0d:79c1)  0.860 ms  0.915 ms  1.005 ms
 2  10gigabitethernet8-2.core3.fmt2.he.net (2001:470:1:3b8::1)  10.615 ms  10.608 ms  7.144 ms
 3  10ge5-4.core1.pao1.he.net (2001:470:0:263::2)  6.539 ms  6.601 ms  6.653 ms
 4  google-as15169.10gigabitethernet8-2.core1.pao1.he.net (2001:470:0:244::2)  0.937 ms  0.905 ms  0.882 ms
 5  2001:4860::1:0:21 (2001:4860::1:0:21)  9.843 ms  9.812 ms  9.740 ms
 6  2001:4860:0:1::3d5 (2001:4860:0:1::3d5)  1.974 ms  1.712 ms  1.979 ms
 7  2607:f8b0:8000:24::2 (2607:f8b0:8000:24::2)  1.575 ms 2607:f8b0:8000:24::7 (2607:f8b0:8000:24::7)  1.637 ms 2607:f8b0:8000:24::1 (2607:f8b0:8000:24::1)  1.684 ms
root@li166-218:~# sysctl net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.forwarding = 1
root@li166-218:~# traceroute -6 google.com
traceroute to google.com (2607:f8b0:4010:801::1000), 30 hops max, 80 byte packets
connect: Network is unreachable

when net.ipv6.conf.all.forwarding = 1 I can ping the host from the guest vm. Hoever the host no longer has public ipv6 connectivity.

1
  • How is your virtual network set up? May 10, 2014 at 19:06

2 Answers 2

6

Enabling IPv6 forwarding will disable IPv6 autoconf. Usually you want routers (devices that forward) to have static addresses.

This is documented in the Linux IPv6 HOWTO.

Here is the relevant part:

forwarding

Type: BOOLEAN

Default: FALSE if global forwarding is disabled (default), otherwise TRUE

Configure interface-specific Host/Router behaviour.

Note: It is recommended to have the same setting on all interfaces; mixed router/host scenarios are rather uncommon.

Value FALSE: By default, Host behaviour is assumed. This means:

  • IsRouter flag is not set in Neighbour Advertisements.
  • Router Solicitations are being sent when necessary.
  • If accept_ra is TRUE (default), accept Router Advertisements (and do autoconfiguration).
  • If accept_redirects is TRUE (default), accept Redirects.

Value TRUE: If local forwarding is enabled, Router behaviour is assumed. This means exactly the reverse from the above:

  • IsRouter flag is set in Neighbour Advertisements.
  • Router Solicitations are not sent.
  • Router Advertisements are ignored.
  • Redirects are ignored.

By setting forwarding to TRUE your machine will behave like a router. You either need to force it to accept Router Advertisements (RAs) or you need to manually configure your addresses and routes.

To enable autoconf even when using forwarding use this:

accept_ra

Type: BOOLEAN

Accept Router Advertisements; autoconfigure using them.

Possible values are:

  • 0: Do not accept Router Advertisements.
  • 1: Accept Router Advertisements if forwarding is disabled.
  • 2: Overrule forwarding behaviour. Accept Router Advertisements even if forwarding is enabled.

Yes, it's a boolean with values 0, 1 and 2 :)

1
  • Setting accept_ra=2 fixed it :\
    – kevzettler
    May 10, 2014 at 19:18
1

Enabling forwarding will wipe out the default route. You can add it back with:

ip -6 route add default via <ipv6 gateway address> dev <interface>

As soon as it is added, IPv6 connectivity should be fine again.

In my case, I had to find the gateway address by snooping around in my cable modem via http://192.168.100.1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .