Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I try to add an IP rule for IPv6 on my Linux system, it errors out:

$ ip -6 rule add fwmark 0xfab lookup 0xf
RTNETLINK answers: Address family not supported by protocol

I checked out the IP rule code; it issues a netlink message to the kernel. Probably I need to load some module, but I don't know which. What do I need to do to fix this?

I am using linux 2.6.37.3 built from kernel sources

Solution: By default linux build doesn't support multiple routing tables for IPv6. You need to enable CONFIG_IPV6_MULTIPLE_TABLES for multiple IPv6 routing table support.

share|improve this question
    
Solution given in question works. –  kjprice Mar 29 '13 at 22:11

2 Answers 2

IPv6 functionality is available to the system by the ipv6 kernel module. To check if this module is currently loaded in your system, issue the following command as root:

lsmod | grep ipv6

If you see ipv6 in its output, then the module is loaded.

Check your /etc/modprobe.conf and see if ipv6 is disabled.

alias ipv6 off
options ipv6 disable=1

It should be

alias net-pf-10 ipv6

Further check the interface specific configuration file: (If you are using a RedHat style distribution like Fedora, CentOS etc.,)

In /etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=yes
IPV6_AUTOCONF=yes

In /etc/sysconfig/network file, if it exists:

NETWORKING_IPV6=yes

And then restart network service And restart the system for cleanly loading the ipv6 kernel module.

share|improve this answer
    
Nikhil, In fact Ipv6 is enabled in my linux box, and I have configured Ipv6 address too. Everything works fine , but I am trying to add an ip rule for Ipv6 which is failing. –  kumar Jan 4 '12 at 7:21

I don't see lookup as a valid option to any ip object. Action for rules include table, nat, prohibit recject, unreachable or realms. From the form of your command I expect you want table. Try

ip -6 rule add fwmark 0xfab table 0xf
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.