1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Linux IPv6 - Destination unreachable

Discussion in 'Networking' started by newhelp, Jun 27, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. newhelp

    newhelp Thread Starter

    Joined:
    Jun 26, 2007
    Messages:
    4
    Linux IPv6 Destination Unreachable problem


    Hello,

    Please help! I am quite new to network programming and so I tested out a sample client-Server application. The TCP or UDP client is either setup as either IPv6 or IPv4, depending on the server address type input by the user on a command line. The server has 4 sockets, one each for TCP/IPv6, TCP/IPv4, UDP/IPv6, UDP/IPv4. There is no router on this network, and the two platforms are on the same link

    The client is able to communicate with the server in following combinations:

    1) Client TCP IPv4, Server IPv4
    2) Client UDP IPv4, Server IPv4
    3) Client TCP IPv6, Server IPv4 using IPv6 mapped IPv4 address
    4) Client UDP IPv6, Server IPv4 using IPv6 mapped IPv4 address
    5) Client TCP IPv6, Server IPv6 both on same plaforms
    6) Client UDP IPv6, Server IPv6 both on same plaforms

    However, the following does not work is client and server are on diffent platforms
    1) Client TCP IPv6, Server IPv6
    2) Client UDP IPv6, Server IPv6

    However, the application has a problem connecting. The tracedump6 shows the ICMPv6 message indicating “Destination unreachable”, “Unreachable address”.

    The ping6 command from client to server platform works fine. I am at a deadend.

    Following are some of the information for debugging. Will appreciate any help I can get in fixing this problem.

    >>>>>>>>>>>>>>ifconfig on server platform >>>>>>>>>>>>>>>>>>>>>>>>>

    [[email protected] nitl]# /sbin/ifconfig

    eth1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:25
    inet addr:10.0.2.21 Bcast:10.0.2.255 Mask:255.255.255.0
    inet6 addr: fe80::21a:a0ff:fe00:eb25/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:839105 errors:0 dropped:0 overruns:0 frame:0
    TX packets:458266 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:97565438 (93.0 MiB) TX bytes:137009860 (130.6 MiB)
    Interrupt:185

    eth1:1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:25
    inet addr:192.168.1.87 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    Interrupt:185

    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:13725 errors:0 dropped:0 overruns:0 frame:0
    TX packets:13725 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7644451 (7.2 MiB) TX bytes:7644451 (7.2 MiB)


    >>>>>>>>>>>>>>ifconfig on client platform >>>>>>>>>>>>>>>>>>>>>>>>>
    [[email protected] nitl]# /sbin/ifconfig

    eth0 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:10
    inet6 addr: fe80::21a:a0ff:fe00:eb10/64 Scope:Link
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:177

    eth1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
    inet addr:10.0.2.29 Bcast:10.0.2.255 Mask:255.255.255.0
    inet6 addr: fe80::21a:a0ff:fe00:eb11/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:620540 errors:0 dropped:0 overruns:0 frame:0
    TX packets:443733 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:87560825 (83.5 MiB) TX bytes:220536906 (210.3 MiB)
    Interrupt:185

    eth1:1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
    inet addr:192.168.1.88 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    Interrupt:185

    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:13194 errors:0 dropped:0 overruns:0 frame:0
    TX packets:13194 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7619229 (7.2 MiB) TX bytes:7619229 (7.2 MiB)


    >>>>>>>>>>>>>>>>> IPv4 route command from client platform >>>>>>>>>>>>

    [[email protected] nitl]# /sbin/route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    10.0.2.0 * 255.255.255.0 U 0 0 0 eth1
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
    default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1


    >>>>>>>>>>>>> IPv6 traceroute command from client to server platform across interface eth1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    [[email protected] nitl]# traceroute -i eth1 fe80::21a:a0ff:fe00:eb25

    traceroute to fe80::21a:a0ff:fe00:eb25 (fe80::21a:a0ff:fe00:eb25), 30 hops max, 40 byte packets

    1 fe80::21a:a0ff:fe00:eb25%eth1 (fe80::21a:a0ff:fe00:eb25) 5.037 ms 0.280 ms 0.126 ms

    >>>>>>>ping6 from client to server platform across interface eth1 >>>>>>>
    [[email protected] Mixed_IPv6_IPv4]# ping6 -I eth1 fe80::21a:a0ff:fe00:eb25

    PING fe80::21a:a0ff:fe00:eb25(fe80::21a:a0ff:fe00:eb25) from fe80::21a:a0ff:fe00:eb11 eth1: 56 data bytes
    64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=0 ttl=64 time=4.59 ms
    64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=1 ttl=64 time=0.148 ms
    64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=2 ttl=64 time=0.130 ms
    64 bytes from fe80::21a:a0ff:fe00:eb25: icmp_seq=3 ttl=64 time=0.130 ms



    >>>>>>>>>>>>> Run Server application which sets up sockets for TCP/UDP IP4 and IPv6 on platform fe80::21a:a0ff:fe00:eb25, port daytime (ie 13)>>>>>>>>>

    [[email protected] Mixed_IPv6_IPv4]# ./testserver -v daytime

    Setting up a passive socket based on the following address info:
    ai_flags = 0x01
    ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
    ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
    ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
    ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 28)
    ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
    sin6_addr: ::
    sin6_port: 13
    sin6_flowinfo: 0
    sin6_scope_id: 0

    Setting up a passive socket based on the following address info:
    ai_flags = 0x01
    ai_family = 2 (PF_INET = 2, PF_INET6 = 10)
    ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
    ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
    ai_addrlen = 16 (sockaddr_in = 16, sockaddr_in6 = 28)
    ai_addr = sin_family: 2 (AF_INET = 2, AF_INET6 = 10)
    sin_addr: 0.0.0.0
    sin_port: 13

    Setting up a passive socket based on the following address info:
    ai_flags = 0x01
    ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
    ai_socktype = 2 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
    ai_protocol = 17 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
    ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 28)
    ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
    sin6_addr: ::
    sin6_port: 13
    sin6_flowinfo: 0
    sin6_scope_id: 0

    Setting up a passive socket based on the following address info:
    ai_flags = 0x01
    ai_family = 2 (PF_INET = 2, PF_INET6 = 10)
    ai_socktype = 2 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
    ai_protocol = 17 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
    ai_addrlen = 16 (sockaddr_in = 16, sockaddr_in6 = 28)
    ai_addr = sin_family: 2 (AF_INET = 2, AF_INET6 = 10)
    sin_addr: 0.0.0.0
    sin_port: 13



    >>>>>>>>>>>>> Run IPv6 client on platform fe80::21a:a0ff:fe00:eb11, interface eth1, specifying server platform fe80::21a:a0ff:fe00:eb25 and server port as daytime (ie port 13) >>>>>>>>>>>>>>>>>>>>>>>>>>

    [[email protected] Mixed_IPv6_IPv4]# ./testtcpclient -v -s eth1 fe80::21a:a0ff:fe00:eb25 daytime

    Address info:
    ai_flags = 0x00
    ai_family = 10 (PF_INET = 2, PF_INET6 = 10)
    ai_socktype = 1 (SOCK_STREAM = 1, SOCK_DGRAM = 2)
    ai_protocol = 6 (IPPROTO_TCP = 6, IPPROTO_UDP = 17)
    ai_addrlen = 28 (sockaddr_in = 16, sockaddr_in6 = 28)
    ai_addr = sin6_family: 10 (AF_INET = 2, AF_INET6 = 10)
    sin6_addr: fe80::21a:a0ff:fe00:eb25%eth1
    sin6_port: 13
    sin6_flowinfo: 0
    sin6_scope_id: 3
    testtcpclient (line 399): System call failed ('connect') - No route to host.
    testtcpclient: Sorry... a connection could not be established.


    >>>>>>>>>>>>tcpdump on server platform : fe80::21a:a0ff:fe00:eb25 >>>>>>

    [[email protected] Mixed_IPv6_IPv4]# /usr/sbin/tcpdump -t -n -i eth1 -s 512 -vv ip6
    tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 512 bytes

    IP6 (hlim 255, next-header: ICMPv6 (58), length: 32) fe80::21a:a0ff:fe00:eb11 >
    ff02::1:ff00:eb25: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has fe80::21a:a0ff:fe00:eb25
    source link-address option (1), length 8 (1): 00:1a:a0:00:eb:11
    0x0000: 001a a000 eb11

    IP6 (hlim 255, next-header: ICMPv6 (58), length: 32) fe80::21a:a0ff:fe00:eb25 >
    fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, neighbor advertisement, length 32,tgt is fe80::21a:a0ff:fe00:eb25, Flags [solicited, override]destination link-address option (2), length 8 (1): 00:1a:a0:00:eb:25
    0x0000: 001a a000 eb25

    IP6 (hlim 64, next-header: TCP (6), length: 40) fe80::21a:a0ff:fe00:eb11.51541 >
    fe80::21a:a0ff:fe00:eb25.daytime: S, cksum 0x0243 (correct),
    343805471:343805471(0) win 5760 <mss1440,sackOK,timestamp 352458977 0,nop,wscale 7>

    IP6 (hlim 64, next-header: ICMPv6 (58), length: 88) fe80::21a:a0ff:fe00:eb25 >
    fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, destination unreachable, length 88, unreachable address fe80::21a:a0ff:fe00:eb25

    IP6 (hlim 255, next-header: ICMPv6 (58), length: 32) fe80::21a:a0ff:fe00:eb25 >
    fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has fe80::21a:a0ff:fe00:eb11
    source link-address option (1), length 8 (1): 00:1a:a0:00:eb:25
    0x0000: 001a a000 eb25

    IP6 (hlim 255, next-header: ICMPv6 (58), length: 24) fe80::21a:a0ff:fe00:eb11 >
    fe80::21a:a0ff:fe00:eb25: [icmp6 sum ok] ICMP6, neighbor advertisement, length 24, tgt is fe80::21a:a0ff:fe00:eb11, Flags [solicited]
     
  2. Sponsor

  3. O111111O

    O111111O

    Joined:
    Aug 26, 2005
    Messages:
    894
    eth0 on client is in same subnet as eth1 on the "client"
    [fe80::21a:a0ff::0/64]

    Try ifdown eth0 and see if the issue is resolved.
     
  4. newhelp

    newhelp Thread Starter

    Joined:
    Jun 26, 2007
    Messages:
    4
    Hello 01111110

    Tried your suggestion! Did not work!

    Here is the result of /sbin/ifconfig on client

    Thanks
    newhelp
    >>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>
    [[email protected] Mixed_IPv6_IPv4]# /sbin/ifconfig
    eth1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
    inet addr:10.0.2.29 Bcast:10.0.2.255 Mask:255.255.255.0
    inet6 addr: fe80::21a:a0ff:fe00:eb11/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:760 errors:0 dropped:0 overruns:0 frame:0
    TX packets:372 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:93037 (90.8 KiB) TX bytes:49082 (47.9 KiB)
    Interrupt:185

    eth1:1 Link encap:Ethernet HWaddr 00:1A:A0:00:EB:11
    inet addr:192.168.1.88 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    Interrupt:185

    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:3460 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3460 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7997353 (7.6 MiB) TX bytes:7997353 (7.6 MiB)

    [
     
  5. O111111O

    O111111O

    Joined:
    Aug 26, 2005
    Messages:
    894
    What's route show now?

    Do /sbin/route and a netstat -rnv to see if either show difference.
     
  6. newhelp

    newhelp Thread Starter

    Joined:
    Jun 26, 2007
    Messages:
    4
    Hello,

    Outputs for IPv6 and IPv4 command families on client and server platfroms!

    Thanks
    newhelp

    **************** using IPv6 address families on client ************
    [[email protected] Mixed_IPv6_IPv4]# /sbin/route -A inet6
    Kernel IPv6 routing table
    Destination Next Hop Flags Metric Ref Use Iface
    ses3/128 * U 0 252 1 lo
    getnameinfo failed
    [UNKNOWN]/128 * U 0 14 1 lo
    getnameinfo failed
    [UNKNOWN]/64 * U 1 0 0 eth1
    getnameinfo failed
    [UNKNOWN]/64 * U 256 0 0 eth1
    getnameinfo failed
    [UNKNOWN]/8 * U 256 0 0 eth1


    [[email protected] Mixed_IPv6_IPv4]# netstat -A inet6 -rnv
    Kernel IPv6 routing table
    Destination Next Hop Flags Metric Ref Use Iface
    ::1/128 :: U 0 252 1 lo
    fe80::21a:a0ff:fe00:eb11/128 :: U 0 14 1 lo
    fe80::/64 :: U 1 0 0 eth1
    fe80::/64 :: U 256 0 0 eth1
    ff00::/8 :: U 256 0 0 eth1

    *************** IPv4 address family on client **********
    [[email protected] Mixed_IPv6_IPv4]# netstat -A inet -rnv
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
    10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
    169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1

    [[email protected] Mixed_IPv6_IPv4]# /sbin/route -A inet
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
    10.0.2.0 * 255.255.255.0 U 0 0 0 eth1
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1


    ****** IPv6 address family on server **************
    [[email protected] Mixed_IPv6_IPv4]# netstat -A inet6 -rnv
    Kernel IPv6 routing table
    Destination Next Hop Flags Metric Ref Use Iface
    ::1/128 :: U 0 591 1 lo
    fe80::21a:a0ff:fe00:eb25/128 :: U 0 1041 1 lo
    fe80::/64 :: U 256 0 0 eth1
    ff00::/8 :: U 256 0 0 eth1
    [[email protected] Mixed_IPv6_IPv4]# /sbin/route -A inet6
    Kernel IPv6 routing table
    Destination Next Hop Flags Metric Ref Use Iface
    ses2/128 * U 0 591 1 lo
    fe80::21a:a0ff:fe00:eb25/128 * U 0 1041 1 lo
    fe80::/64 * U 256 0 0 eth1
    ff00::/8 * U 256 0 0 eth1


    ************** IPv4 address family on server *********
    [[email protected] nitl]# /sbin/route -A inet
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
    [[email protected] nitl]# netstat -A inet -rnv
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
     
  7. O111111O

    O111111O

    Joined:
    Aug 26, 2005
    Messages:
    894
    Ok.

    Well, you did have two interfaces on client in same subnet (that's no-no)

    However, going back to original message with your tcpdump eb25 is sending a destination unreachable to eb11 (fe80::21a:a0ff:fe00:eb25 >fe80::21a:a0ff:fe00:eb11)

    This means that your server does receive the message, but there's no service listening on that port and an unreachable was generated. I guess I should have stared at that a bit longer.

    So, when you did the original tcpdump were you trying to connect to TCP 13?

    What interfaces are services listening to on server?

    Did you try to telnet6 from client to server?
    Did you try to telnet6 from client to server port x (i.e. 13, 22, etc.)
     
  8. newhelp

    newhelp Thread Starter

    Joined:
    Jun 26, 2007
    Messages:
    4
    Hi,

    Sorry for the lateness in response, but the network was down yesterday evening.

    -------------------------------------------- ICMPv6 packet -------------------------------
    IP6 (hlim 64, next-header: ICMPv6 (58), length: 88) fe80::21a:a0ff:fe00:eb25 >
    fe80::21a:a0ff:fe00:eb11: [icmp6 sum ok] ICMP6, destination unreachable, length 88, unreachable address fe80::21a:a0ff:fe00:eb25
    -----------------------------------------------------------------------------------

    I had looked at the ICMPv6 packet, and it indicated "destination unreachable" message type, with "unreachable address" (code 3). Should it not be "port unreachable" (code 4) for no listener. Besides, I successfuly ran the client and server on same platform, and so the server is listening on port 13, and have problems only with two different platforms with IPv6 only.


    I do not have telnet6. However, I tried "ssh" after running the server with IPv4 address 192.168.1.88, since the server also listens on port 13 after establishing TCP/UDP sockets on both IPv4 and IPv6. Below is what I got.

    [[email protected] Mixed_IPv6_IPv4]# ssh -p 13 192.168.1.88
    ssh: connect to host 192.168.1.88 port 13: No route to host

    On the client side I specify the interface as "eth1" and hence the client scope Id field has value 3. (Value 2 is eth0).

    In the server application the interfaces are filled in automatically by an API, and is shown in the scopeId field with value 0. I'm not sure what that means,since I am testing out the program I got on the internet.

    Let me point out my program to you, and you may be able to run it on your platforms and better understand the problem. It takes a few minutes to copy the server and tcp client programs to your machines from the web and compile it, and it runs right away. I used gcc to compile.

    gcc -o server server.c
    gcc -o tcpclient

    http://www.tldp.org/HOWTO/html_single/Linux+IPv6-HOWTO/index.html#CHAPTER-SECTION-USING-API

    server is in section 22.1.4.1, and the TCP client in 22.1.4.2
     
  9. O111111O

    O111111O

    Joined:
    Aug 26, 2005
    Messages:
    894
    Yep. Ok. Don't really care about the app right now because you have a lower lying issue. Also don't care that they worked on the same host as you're not really making any routing decisions at that point.

    If you can't ssh to an IPV4 address there's something I'm not seeing / you're not showing me.

    If you can't SSH to 192.168.1.88 can you SSH to the 10.x address?

    Did you restart network services?

    Is iptables running?

    Are you running Zebra?
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/589152