IPv6 design, deployment, standards, and best practices.
User avatar
kiran_kankipati
New Member
Posts:
3
Joined:
Tue Jun 24, 2014 9:36 am
Certs:
CCNA

Getting IPv6 Address list of a port in Linux

Tue Jun 24, 2014 9:59 am

Hi

Is there a way to get specific IPv6 address list of a specific port in Linux ?

I can do:
[kiran@localhost ~]$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 1674 bytes 133272 (130.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1674 bytes 133272 (130.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

p8p1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 74:86:7a:27:c4:8a txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.105 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::be85:56ff:fe9e:54b3 prefixlen 64 scopeid 0x20<link>
ether bc:85:56:9e:54:b3 txqueuelen 1000 (Ethernet)
RX packets 291998 bytes 276819985 (263.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 257983 bytes 47562873 (45.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[kiran@localhost ~]$
[kiran@localhost ~]$ ifconfig wlp2s0 | grep inet6
inet6 fe80::be85:56ff:fe9e:54b3 prefixlen 64 scopeid 0x20<link>
[kiran@localhost ~]$


But if there is a specific way to get v6 addresses ?
Since it is often a case that one port may have multiple v6 addresses :(

Thank you.
cheers, Kiran
Founder: TrafficSqueezer - Linux Open-Source WAN Optimization
Website: www.trafficsqueezer.org

pbritoferreira
New Member
Posts:
5
Joined:
Mon Oct 13, 2014 3:19 pm
Certs:
CCENT, CCNA R&S, CCNP R&S, LPIC1, LPIC2

Re: Getting IPv6 Address list of a port in Linux

Mon Oct 13, 2014 4:18 pm

It works for me with more than one IPv6 address:

Code: Select all
root@home:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:ba:bb:cf 
          inet addr:192.168.31.138  Bcast:192.168.31.255  Mask:255.255.255.0
          inet6 addr: 2001:470:1f07:dff:a00:27ff:feba:bbcf/64 Scope:Global
          inet6 addr: fe80::a00:27ff:feba:bbcf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6694 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4067 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7494151 (7.1 MiB)  TX bytes:591273 (577.4 KiB)

root@home:~# ifconfig eth0 | grep inet6
          inet6 addr: 2001:470:1f07:dff:a00:27ff:feba:bbcf/64 Scope:Global
          inet6 addr: fe80::a00:27ff:feba:bbcf/64 Scope:Link
root@home:~# ip -6 addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:470:1f07:dff:a00:27ff:feba:bbcf/64 scope global dynamic
       valid_lft 2591977sec preferred_lft 604777sec
    inet6 fe80::a00:27ff:feba:bbcf/64 scope link
       valid_lft forever preferred_lft forever
root@home:~# ip -6 addr show dev eth0 | grep inet6
    inet6 2001:470:1f07:dff:a00:27ff:feba:bbcf/64 scope global dynamic
    inet6 fe80::a00:27ff:feba:bbcf/64 scope link
root@home:~# uname -a
Linux home 2.6.32-5-amd64 #1 SMP Mon Sep 23 22:14:43 UTC 2013 x86_64 GNU/Linux
root@home:~# cat /etc/debian_version
6.0.9
root@home:~#

'

Return to IPv6

Who is online

Users browsing this forum: No registered users and 2 guests