This tutorial will try to test IPv6 implementation on Solaris (Opensolaris 2009.06) and Linux (Slackware 12.2). Both OS are already support IPv6 by default so we just enable/activate it.
The schenario of this test is using direct connection between the two OSes and using existing private IP addresses. IPv6 makes it very easy to assign existing addresses.
For example, the Linux IP address is 172.16.17.16 and the Opensolaris IP address is 172.16.17.238. We change the ip address in hex (IPv6 format) become ::AC10:1110 and ::AC10:11EE respectively. The :: is a short form available in IPv6 to represent zeros.
OK lets configure the Linux OS first. Make sure the ipv6 module is already loaded to the kernel.
root@slacky:~# lsmod | grep ipv6
ipv6 234724 35
If you see that the ipv6 module is already loaded like above, you are ready to set the ipv6 on the Linux NIC.
In my Linux box, the NIC is eth0 so lets go ahead to the setting. The commands are as below:
root@slacky:~# ifconfig eth0 inet6 add ::ac10:1110/64
root@slacky:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0f:ea:02:c8:99
inet6 addr: ::172.16.17.16/64 Scope:Compat
inet6 addr: fe80::20f:eaff:fe02:c899/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:611848361 errors:0 dropped:426 overruns:0 frame:0
TX packets:617533449 errors:1 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2168941762 (2.0 GiB) TX bytes:4173512057 (3.8 GiB)
Interrupt:19 Base address:0x4000
Verify to ping to the new ipv6 address.
root@slacky:~# ping6 ::ac10:1110
PING ::ac10:1110(::172.16.17.16) 56 data bytes
64 bytes from ::172.16.17.16: icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from ::172.16.17.16: icmp_seq=2 ttl=64 time=0.044 ms
64 bytes from ::172.16.17.16: icmp_seq=3 ttl=64 time=0.048 ms
64 bytes from ::172.16.17.16: icmp_seq=4 ttl=64 time=0.049 ms
--- ::ac10:1110 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.041/0.045/0.049/0.007 ms
You can see above that ::ac10:1110 (in hex) become ::172.16.17.16 (in dec).
OK configuring IPv6 on the Linux box was done. The next is configuring IPv6 on the Opensolaris machine.
The configuration is based on “System Administration Guide: IP Services”. You can download this doc from the Sun website http://docs.sun.com.
In my Opensolaris box, the NIC is detected as ‘rtls0’ because I use Realtek chipset.
To assign an IPv6 address, we must plumb it up first and then assign the ipv6 address. Otherwise we will get an error message telling us that there is no such interface as below:
root@opensolaris:~# ifconfig rtls0 inet6 addif ::ac10:11ee/64
ifconfig: addif: SIOCLIFADDIF: rtls0: no such interface
OK lets plumb it up first!
root@opensolaris:~# ifconfig rtls0 inet6 plumb up
root@opensolaris:~# ifconfig rtls0 inet6 addif ::ac10:11ee/64 up
Created new logical interface rtls0:1
Note that you have to tell the interface ‘up’ when adding the ipv6 address. If not you will not be able to ping to the new ipv6 address. To make sure you can try to ping to the new ipv6 address.
root@opensolaris:~# ping -s ::ac10:11ee
PING ::ac10:11ee: 56 data bytes
64 bytes from ::172.16.17.238: icmp_seq=0. time=0.109 ms
64 bytes from ::172.16.17.238: icmp_seq=1. time=0.141 ms
64 bytes from ::172.16.17.238: icmp_seq=2. time=0.128 ms
64 bytes from ::172.16.17.238: icmp_seq=3. time=0.126 ms
64 bytes from ::172.16.17.238: icmp_seq=4. time=0.125 ms
^C
----::ac10:11ee PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.109/0.126/0.141/0.011
Now it is the time to ping from Opensolaris machine to Linux box or vise versa.
From Opensolaris to Linux box:
root@opensolaris:~# ping -s ::ac10:1110
PING ::ac10:1110: 56 data bytes
64 bytes from ::172.16.17.16: icmp_seq=0. time=0.287 ms
64 bytes from ::172.16.17.16: icmp_seq=1. time=0.275 ms
64 bytes from ::172.16.17.16: icmp_seq=2. time=0.261 ms
64 bytes from ::172.16.17.16: icmp_seq=3. time=0.300 ms
^C
----::ac10:1110 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.261/0.281/0.300/0.017
From Linux to Opensolaris box:
root@slacky:~# ping6 ::ac10:11ee
PING ::ac10:11ee(::172.16.17.238) 56 data bytes
64 bytes from ::172.16.17.238: icmp_seq=1 ttl=255 time=1.70 ms
64 bytes from ::172.16.17.238: icmp_seq=2 ttl=255 time=0.233 ms
64 bytes from ::172.16.17.238: icmp_seq=3 ttl=255 time=0.237 ms
64 bytes from ::172.16.17.238: icmp_seq=4 ttl=255 time=0.234 ms
--- ::ac10:11ee ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.233/0.601/1.701/0.635 ms
Hope this tutorial is clear and will be useful for you.