Wednesday, March 30, 2016

enable ipv6 routing on linux

to enable ipv4 routing we can change the value of  /proc/sys/net/ipv4/ip_forward to 1, but for ipv6 we change on different file

client1: 2002:f388:1:1::2/64
client2: 2002:f388:1:2::2/64
linux-router:  interface1, vmnet1:2002:f388:1:2::1/64 (connect to client 2)
                      interface2, vboxnet0:2002:f388:1:1::1/64 (connect to client 1)

$ sudo ifconfig eth0 inet6 add 2002:f388:1:1::2/64
$ sudo ip -6 route add default via 2002:f388:1:1::1

$ sudo ifconfig eth0 inet6 add 2002:f388:1:2::2/64
$ sudo ip -6 route add default via 2002:f388:1:2::1

$ sudo ifconfig vboxnet0 inet6 add 2002:f388:1:1::1/64
$ sudo ifconfig vmnet1 inet6 add 2002:f388:1:2::1/64
$ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

- to ping test on client
$ ping6  2002:f388:1:2::2
$ ping6  2002:f388:1:1::2

-screenshot ping6 from client1 to client2

No comments:

Post a Comment