netstat doesn't display ipv6 addresses correctly (they are truncated)

Bug #511401 reported by ndv
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
net-tools (Debian)
Fix Released
Undecided
Unassigned
net-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I just installed miredo and begun to use ipv6. I've noticed that netstat is incapable to display correctly the sockets when it is instructed to display the ipv6 address instead of the name, thus making it useless.

the command issued is
  netstat -n --tcp
the result is something similar to:

Active Internet connections (senza server)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 48 2001:xxxx:yyyy:324:22222 2001:0:zzzz:64c:3:55249 ESTABLISHED
tcp6 0 0 2001:xxxx:yyyy:324::2:80 2001:0:zzzz:64c:3:51862 TIME_WAIT

(please note that xxxx yyyy zzzz masks real part of the ipv6 address because of privacy)

the result shown by netstat is incomplete, because the ipv6 addresses are truncated in half thus making the netstat command completely useless (I cannot understand who's connecting or whom I'm connecting with).
enlarging the terminal doesn't help.
the question:

is it a bug? is there something I can do?
thanks a lot
ndv

Tags: ipv6
affects: ubuntu → net-tools (Ubuntu)
Emmet Hikory (persia)
tags: added: ipv6
Revision history for this message
Mark Hobley (markhobley) wrote :

On my (Debian) based system, it truncates foreign domain names too. This is really annoying!

Revision history for this message
Valentijn Sessink (valentijn) wrote :

When using the "-W" ("--wide") option, the addresses are readable. However, the "wide" option is not available under Ubuntu 8.04 LTS. It is available under Ubuntu 10.04 LTS.

Changed in net-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Alan Robertson (alanr-unix) wrote :

Problem still exists!

# netstat -ntp | grep pidgin
tcp6 0 0 2601:1:ad80:1445::54776 2620:0:861:52:208::6667 ESTABLISHED 2043/pidgin

This address is from irc.freenode.net
2620:0:861:52:208:80:155:68

Revision history for this message
MihanIT (mihanit) wrote :

netstat -T option is for stop trimming long addresses in many platformas like Fedora but unfortunately Ubuntu does not has this option.

Revision history for this message
sandipahire007 (sandipahire007) wrote :

hi,

how to connect From ipv6 to ipv6 rdesktop.

my site ip is :- 2014:1001:5:105::113

remote ip is : 2014:1001:5:105::209

how can possible rdesktop.

any command..

Revision history for this message
Antonio Ospite (ospite) wrote :

I think this bug can be closed, recent netstat versions have the -W (or --wide) option to show the full adresses.

To restore tabulation alignment, a wrapper can be used:

netstat -tunap --wide | \
      sed -e '1d' -e '2s/ \(Address\)/_\1/g' -e '2s/\(Program\) /\1_/' -e 's/\([^0-9]*:\) /\1/' -e '/^udp/s/:\*/:\* -/' | \
      column -t

Also, "ss" could be used instead of netstat, ss does not truncate the addresses.

Changed in net-tools (Ubuntu):
status: Confirmed → Fix Released
Changed in net-tools (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.