2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linux IPv6 関連コマンドメモ

Last updated at Posted at 2019-07-29

Linux で IPv6 を利用する際の基本的なコマンドメモ

インタフェイスに付与されたアドレス確認

$ ip address show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 06:a3:df:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 172.31.xx.xx/20 brd 172.31.xx.xx scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2xxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link 
       valid_lft forever preferred_lft forever

ルーティングテーブル

$ ip -6 route list type unicast
2xxx:xxxx:xxxx:xxxx::/64 dev eth0  proto kernel  metric 256  pref medium
fe80::/64 dev eth0  proto kernel  metric 256  pref medium
default via fe80::xxxx:xxxx:xxxx:xxxx dev eth0  proto ra  metric 1024  expires xxxsec hoplimit 64 pref medium

Ping 疎通確認

  • localhost
$ ping6 ::1
  • google
$ ping6 2001:4860:4860::8888

curl 接続確認

$ curl -6 -i https://www.jpn.earth/remote_addr.cgi
HTTP/2 200 
date: Mon, 29 Jul 2019 14:54:49 GMT
content-type: text/plain; charset=UTF-8

2xxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx

DNS

$ dig aaaa www.google.com +rec +short
2404:6800:4004:81a::2004

公開サービス

$ ss -al -6
Netid                  State                   Recv-Q                  Send-Q                                    Local Address:Port                                              Peer Address:Port                  
raw                    UNCONN                  0                       0                                                     *:ipv6-icmp                                                    *:*                     
udp                    UNCONN                  0                       0                                                     *:dhcpv6-client                                                *:*                     
udp                    UNCONN                  0                       0                                                     *:45617                                                        *:*                     
udp                    UNCONN                  0                       0                                                     *:mdns                                                         *:*                     
tcp                    LISTEN                  0                       128                                                [::]:ssh                                                       [::]:*                     

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?