Connecting to remote IPv6 addresses from Linux machine requires local scope id
"Dhiren Chandvania" <[email protected]> Mon, 24 Jul 2006 18:36:30 +0530
| Newsgroups | gmane.network.ipv6.general |
|---|---|
| Message-ID | <0ED7969A003F1B48BE956A4CA691B80101B236B1@ITPXCHCLN1.enterprise.veritas.com> |
Configuration details:
Linux:
------
/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:6E:38:EA:EF
inet addr:10.212.86.40 Bcast:10.212.87.255
Mask:255.255.254.0
inet6 addr: fe80::230:6eff:fe38:eaef/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:141195117 errors:0 dropped:0 overruns:0 frame:0
TX packets:140958025 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:54506828681 (50.7 GiB) TX bytes:71024803048 (66.1
GiB)
Base address:0xa080 Memory:d0000000-d0020000
eth0:0 Link encap:Ethernet HWaddr 00:30:6E:38:EA:EF
inet addr:192.168.1.223 Bcast:192.168.1.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xa080 Memory:d0000000-d0020000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:64880485 errors:0 dropped:0 overruns:0 frame:0
TX packets:64880485 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:352566279113 (328.3 GiB) TX bytes:352566279113
(328.3 GiB)
sigfs Link encap:IPv6-in-IPv4
inet6 addr: fe80::c0a8:1df/128 Scope:Link
UP POINTOPOINT RUNNING NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:825 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:66116 (64.5 KiB)
Solaris:
--------
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index
2
inet 10.212.86.153 netmask fffffe00 broadcast 10.212.87.255
ether 0:3:ba:2:cc:ee
hme0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500
index 2
inet 192.168.5.113 netmask ffffff00 broadcast 192.168.5.255
lo0: flags=2000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6> mtu 8252 index 1
inet6 ::1/128
hme0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
ether 0:3:ba:2:cc:ee
inet6 fe80::203:baff:fe02:ccee/10
ip.tun0: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu
1480
index 3
inet tunnel src 192.168.5.113 tunnel dst 192.168.1.223
inet6 fe80::c0a8:571/10 --> fe80::c0a8:1df
Issues that I have:
I]
All outbound traffic from a Linux machine needs scope id. Why?
Tried the following sample for Solaris-Linux combination
Server on Solaris
------------------
bash-2.03# ./dtserver
Client on Linux (With scope id)
----------------
/var/tmp/test/dc/petes
[root@sss964b1 petes]# ./dtclient fe80::203:baff:fe02:ccee%2
Dhiren: Wed Jun 28 02:52:33 2006
The above client successfully connects to the Solaris server and
retrieves the time from the server.
Client on Linux (Without scope id)
----------------
[root@sss964b1 petes]# ./dtclient fe80::203:baff:fe02:ccee
client error:: could not create connected socket socket
[II]
Linux-Linux communication on IPv6 does not work even on specifying the
scope
id. This is messy and shouldn't it work ? Please provide your comments.
Server on Linux
----------------
[root@sss964b1 petes]# pwd
/var/tmp/test/dc/petes
[root@sss964b1 petes]# ./dtserver
Client on Linux
----------------
[root@sss964b1 petes]# pwd
/var/tmp/test/dc/petes
./dtclient fe80::230:6eff:fe38:eaef%2
The client waits in connect call whereas the server does not get any
request
and is waiting in accept call
client:
--------
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 3
connect(3, {sa_family=AF_INET6, sin6_port=htons(3333),
inet_pton(AF_INET6,
"fe80::230:6eff:fe38:eaef", &sin6_addr), sin6_flowinfo=0,
sin6_scope_id=if_nametoindex("eth0")}, 28
server
-------
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 3
bind(3, {sa_family=AF_INET6, sin6_port=htons(3333), inet_pton(AF_INET6,
"::",
&sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
listen(3, 128) = 0
accept(3,
[root@sss964b1 /]# netstat -a | grep 3333
tcp 0 0 *:3333 *:*
LISTEN
tcp 0 1 ::1:36188
fe80::230:6eff:fe38:ea:3333
SYN_SENT
All the sample applications source code is attached:
Thanks in advance.
Dhiren