2

I'm currently trying to setup IPv6 address auto-configuration with router advertisement daemon (radvd) on a virtual machine running CentOS 6.5. But the eth0 interface is not obtaining that prefix.

I've obtained the ULA prefix from here.

Contents of /etc/sysctl.conf

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0
net.ipv6.conf.all.forwarding = 1

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296

Contents of /etc/radvd.conf

# NOTE: there is no such thing as a working "by-default" configuration file. 
#       At least the prefix needs to be specified.  Please consult the radvd.conf(5)
#       man page and/or /usr/share/doc/radvd-*/radvd.conf.example for help.
#
#
interface eth0
{
    AdvSendAdvert on;
    MinRtrAdvInterval 3;
    MaxRtrAdvInterval 10;
    AdvDefaultPreference low;
    AdvHomeAgentFlag off;
    prefix fd8a:8d9d:808f:1::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr on;
    };

};

Contents of /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=52:54:00:74:d7:46
TYPE=Ethernet
UUID=af5db1cb-e809-4098-be1a-5a74dbb767b1
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
IPV6INIT=yes
IPV6_AUTOCONF=yes

I've also enabled radvd at startup through chkconfig. Though I noticed that radvd is starting after interfaces are brought up. I've tried restarting the network service afterwards but still I get the following link-local address only

#ip -6 addr show
1: lo:  mtu 16436 
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qlen 1000
    inet6 fe80::5054:ff:fe74:d746/64 scope link 
       valid_lft forever preferred_lft forever

Edit: Based on the answer given by Sander Steffann

I still need clarification on some points but I'm posting here what worked. Contents of /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=syslog-ng-server
NETWORKING_IPV6=yes
IPV6FORWARDING=yes

Contents of /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=52:54:00:74:d7:46
TYPE=Ethernet
UUID=af5db1cb-e809-4098-be1a-5a74dbb767b1
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6FORWARDING=no

Removed following line from /etc/sysctl.conf

net.ipv6.conf.all.forwarding = 1

Contents of /etc/radvd.conf is as previous.

2
  • 1
    I'm a bit confused. Are you trying to set up a router (then you need radvd) or are you trying to get an autoconfigured address on your host, then you need a router who is sending RAs. radvd is not required on a host.
    – Sebastian
    Commented May 27, 2014 at 9:25
  • The above configuration I'm trying is for a IPv6 router. I'm trying to provide autoconfigured address routing/gateway interface of the router, too.
    – Samik
    Commented May 27, 2014 at 10:17

1 Answer 1

2

IPv6 auto configuration doesn't work when combined with IPv6 forwarding. On a router you usually configure static addresses, especially on the interface where you are sending out RAs.

Although this question is about Ubuntu, its answer may help you in the case where you want to use autoconf on the upstream interface and send RAs on the downstream interface: https://askubuntu.com/questions/463625/ipv6-forwarding-kills-ipv6-connection/463654#463654

3
  • I'm really not getting what's going on here. First I turned off kernel IPv6 forwarding from sysctl.conf and rebooted, radvd was running, but didn't assigned prefix to eth0. Then I tried putting static IPv6 address with IPV6ADDR=fd8a:8d9d:808f:1::1, restarted network, still no joy. Finally I tried putting IPV6FOWARDING=no in /etc/sysconfig/network and restarted network. eth0 now got that ULA, but after rebooting, radvd is failing to even start, stating IPv6 forwarding seems to be disabled, exiting. What finally worked I'm posting in edit.
    – Samik
    Commented May 28, 2014 at 5:38
  • You are misunderstanding the purpose of radvd. It is a Router Advertisement Daemon, meaning that you run in on a router to advertise its presence so that other systems can use it as a default gateway and auto-configure themselves based on the information it sends out. Do not run it on something that isn't a router+default gateway, and configure the router itself statically. Commented May 28, 2014 at 13:49
  • I need to clarify that the aforesaid VM is indeed meant to act as a router and should advertise gateway IP + prefix on eth0 which will be the gateway interface for other clients connecting to it. I just wanted the gateway interface to get autoconfugured address from the radvd daemon as well. So in the above setup I enabled IPv6 forwarding globally in /etc/sysconfig/network and disabled it only for eth0 in /etc/sysconfig/network-scripts/ifcfg-eth0. After starting other VMs(Windows and Linux) on same network they got that prefix as well. I've not checked routing yet.
    – Samik
    Commented May 30, 2014 at 6:31

You must log in to answer this question.

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