Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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

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


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


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


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.