IPv6 address is not working in Ubuntu

5,040

Solution 1

The problen is solved by adding flags = IPv6 line to \etc\xinetd.d\echo file:

service echo
{
    disable     = no
    type        = INTERNAL
    id      = echo-stream
    socket_type = stream
    protocol    = tcp
        flags           = IPv6  
    user        = root
    wait        = no
}                                                                               


service echo
{
    disable     = no
    type        = INTERNAL
    id      = echo-dgram
    socket_type = dgram
    protocol    = udp
        flags           = IPv6  
    user        = root
    wait        = yes
}                                                                               

Solution 2

I think this will work for you... First install xinetd using this command.

root@localhost:~#apt-get install xinetd

Then change to this directory

root@localhost:~# cd /etc/xinetd.d/

create on file named as telnet

open that file(telnet) and copy this content to that file

service telnet
 { disable     = no
   flag        = REUSE
   socket_type = stream
   wait        = no
   user        = root
  server       = /usr/sbin/in.telnetd
log_on_failure += USERID
}

Then restart the xinetd service using this command

root@localhost:~# service xinetd restart

Thats it.

Now check the telnet

root@localhost:~# telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Ubuntu 12.04 LTS
localhost login: max
Password: 
Last login: Thu Nov 29 20:00:24 IST 2012 from localhost on pts/3
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/

max@localhost:~$ exit
logout
Connection closed by foreign host.
root@localhost:~# telnet ::1
Trying ::1...
Connected to ::1.
Escape character is '^]'.
Ubuntu 12.04 LTS
localhost login: max
Password: 
Last login: Thu Nov 29 20:01:26 IST 2012 from localhost on pts/5
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/

max@localhost:~$ exit
logout
Connection closed by foreign host.
Share:
5,040

Related videos on Youtube

Alex F
Author by

Alex F

Updated on September 18, 2022

Comments

  • Alex F
    Alex F over 1 year

    Telnet connection with echo service succeeds for localhost and 127.0.0.1 host names, but fails with ::1 host name:

    alex@u120432:~$ telnet localhost 7
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    123
    123
    ^]
    
    telnet> q
    Connection closed.
    alex@u120432:~$ telnet ::1 7
    Trying ::1...
    telnet: Unable to connect to remote host: Connection refused
    alex@u120432:~$ 
    

    My own program trying to talk using IPv6 address fails as well. Why IPv6 address is rejected?

    OS: Ubuntu 12.04 32 bit.

    Additional information:

    For any TCP/UDP server-client programs (not only telnet + echo) I tried different host names. Assuming that computer IP address is 10.90.185.73 (fe80::21b:21ff:fe5e:28af), I tested the following options:

    localhost - works
    127.0.0.1 - works
    ::1 - Connection refused
    10.90.185.73 - works
    computer-name - works
    ::ffff:10.90.185.73 - works
    fe80::21b:21ff:fe5e:28af - Connection refused
    
    • max
      max over 11 years
      can you paste your /etc/xinetd.d/telnet setting here.
    • Alex F
      Alex F over 11 years
      @max: /etc/xinetd.d/telnet: No such file or directory
    • max
      max over 11 years
      ok ubuntu right sorry my mistake...
    • gertvdijk
      gertvdijk over 11 years
      Run netstat -ntlp and you'll probably find your service to be listening on IPv4 only. Change your echo service to bind to IPv6 as well.
    • Alex F
      Alex F over 11 years
      @gertvdijk - "Change your echo service to bind to IPv6 as well" - how exactly can I do this? Echo service itself it not so interesting to me, my problem is that any program doesn't work with IPv6 address.
  • Alex F
    Alex F over 11 years
    Echo service is active - connection with 127.0.0.1 or localhost works.
  • Alex F
    Alex F over 11 years
    Thanks. The first part is already done - echo service is active and replies to 127.0.0.1 address. telnet ::1 is not working. More important, my own program doesn't work with IPv6 address...