7

I am trying to set up a basic IPv6 only echo-server using netcat (or rather nc6). Client and server are both in the same local network. However, the client quits immediately:


IPv6-Server:

$ nc6 -6 -vv --continuous --exec cat -l -p 5555
nc6: listening on :: 5555 ...

IPv6-Client:

$ nc6 -6 -vv fe80::213:33ff:feab:ff5d 5555
nc6: fe80::213:33ff:feab:ff5d (fe80::213:33ff:feab:ff5d) 5555 [5555] open
nc6: using stream socket
nc6: using buffer size of 8192
nc6: error reading from remote: Transport endpoint is not connected
nc6: connection closed (sent 0, rcvd 0)
nc6: readwrite returned -1
nc6: closed local
nc6: closed remote
$ 

What's the issue?
Should I configure the server to listen to incoming connections only on one of its interfaces? (how?)


IPv4 Version works just fine:

IPv4-Server:

nc6 -vv --continuous --exec cat -l -p 5555
nc6: listening on :: 5555 ...
nc6: listening on 0.0.0.0 5555 ...
nc6: connect to 192.168.1.35 5555 from xyrobert.local (192.168.1.35) 37928 [37928]
nc6: using stream socket
nc6[7502]: executing 'cat'
nc6[7502]: using buffer size of 8192
nc6[7502]: read 4 bytes from remote
nc6[7502]: wrote 4 bytes to local
nc6[7502]: read 4 bytes from local
nc6[7502]: wrote 4 bytes to remote

IPv4-Client:

nc6 -vv 192.168.1.35 5555
nc6: kearney.local (192.168.1.35) 5555 [5555] open
nc6: using stream socket
nc6: using buffer size of 8192
Hi!
nc6: read 4 bytes from local
nc6: wrote 4 bytes to remote
nc6: read 4 bytes from remote
Hi!
nc6: wrote 4 bytes to local
9

When connecting to an IPv6 link-local address you need to specify through which link to reach it, as seen from the client system. The same link-local addresses are used on every link, so the client needs to be told explicitly which link (interface) to use. So if the system you want to reach is connected through eth0 of the client system, you need to connect to fe80::213:33ff:feab:ff5d%eth0.

Using routable IPv6 addresses is much easier as then the local routing table will be used to determine through which interface to send the packet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.