# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:12:78:03
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe12:7803/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4746 errors:0 dropped:0 overruns:0 frame:0
TX packets:3657 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:471968 (460.9 KiB) TX bytes:563550 (550.3 KiB)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:592 (592.0 b) TX bytes:592 (592.0 b)
其中eth0的inet addr:192.168.0.102就是ipv4地址
其中lo的inet addr:127.0.0.1就是ipv4地址
其中eth0的inet6 addr: fe80::20c:29ff:fe12:7803就是ipv6地址
其中lo的inet6 addr: ::1就是ipv6地址
ping
# ping6 -I lo ::1
PING ::1(::1) from ::1 lo: 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=10.8 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.710 ms
# ping6 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=29.0 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.495 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.285 ms
# ping6 -I eth0 fe80::20c:29ff:fe12:7803
PING fe80::20c:29ff:fe12:7803(fe80::20c:29ff:fe12:7803) from fe80::20c:29ff:fe12:7803 eth0: 56 data bytes
64 bytes from fe80::20c:29ff:fe12:7803: icmp_seq=1 ttl=64 time=0.541 ms
64 bytes from fe80::20c:29ff:fe12:7803: icmp_seq=2 ttl=64 time=0.284 ms
64 bytes from fe80::20c:29ff:fe12:7803: icmp_seq=3 ttl=64 time=0.292 ms
telnet
# telnet -8 ::1 22
Trying ::1...
Connected to ::1.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
# telnet -8 fe80::20c:29ff:fe12:7803%eth0 22
Trying fe80::20c:29ff:fe12:7803%eth0...
Connected to fe80::20c:29ff:fe12:7803%eth0.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3