我似乎无法访问服务。
使用VMWare Fusion启动下载的VM image(在Mac OS X 10.8.2上)
ifconfig返回以下内容:

em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
    ether 00:50:56:25:fd:9a
    inet6 dc20:c7f:2012:12::7 prefixlen 64
    inet6 fe80::250:56ff:fe25:fd9a%em1 prefixlen 64 scopeid 0x3
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
[root@dc20 ~]# sockstat -6:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     cashew     1447  3  tcp6   dc20:c7f:2012:12::7:7979 *:*
root     cherry     1443  3  tcp6   dc20:c7f:2012:12::7:24359 *:*
root     coney      1439  3  tcp6   dc20:c7f:2012:12::7:65214 *:*
root     dealer     1435  4  tcp6   dc20:c7f:2012:12::7:8888 *:*
root     desheepd   1431  3  udp6   dc20:c7f:2012:12::7:547 *:*
root     dog        1427  3  tcp6   *:3146                *:*
root     gallows    1415  3  tcp6   dc20:c7f:2012:12::7:6666 *:*
root     jerkin     1395  3  tcp6   dc20:c7f:2012:12::7:63715 *:*
root     mixology   1387  3  tcp6   dc20:c7f:2012:12::7:35575 *:*
root     nancy      1379  3  tcp6   dc20:c7f:2012:12::7:57554 *:*
root     nom        1370  3  tcp6   dc20:c7f:2012:12::7:7368 *:*
nssds    nssds      1366  3  tcp6   dc20:c7f:2012:12::7:54339 *:*
root     ocrd       1362  4  tcp6   dc20:c7f:2012:12::7:31967 *:*
root     parrot     1357  3  tcp6   *:5160                *:*
root     ralph      1353  3  tcp6   dc20:c7f:2012:12::7:57553 *:*
scool    scool      1349  3  tcp6   *:4637                *:*
root     semem      1332  3  tcp6   dc20:c7f:2012:12::7:6941 *:*
root     sshd       1316  3  tcp6   *:22                  *:*
tictactoe tictactoe 1223  3  tcp6   dc20:c7f:2012:12::7:25375 *:*
_ngircd  ngircd     1210  10 tcp6   ::1:6667              *:*
_ngircd  ngircd     1210  11 tcp6   ::1:6668              *:*
_ngircd  ngircd     1210  12 tcp6   ::1:6669              *:*
_ngircd  ngircd     1210  13 tcp6   dc20:c7f:2012:12::7:6667 *:*
_ngircd  ngircd     1210  14 tcp6   dc20:c7f:2012:12::7:6668 *:*
_ngircd  ngircd     1210  15 tcp6   dc20:c7f:2012:12::7:6669 *:*
root     zul        1083  3  tcp6   dc20:c7f:2012:12::7:25201 *:*
root     syslogd    1057  6  udp6   *:514                 *:*

但是我似乎无法连接到任何形式为dc20:c7f:2012:12::7:的服务,例如,能够向/从在dc20:c7f上运行的semem服务发送/接收: 2012:12::7,端口6941

我尝试了诸如ping6telnet -6netcat/nmap的基本内容,以及python套接字,但它们似乎无法连接(超时)。

另一个*:服务运行良好。

我从Google搜索结果中了解到dc20:c7f:2012:12::7:6941表示该服务已绑定(bind)到与ipv6地址“dc20:c7f:2012:12::7”关联的接口(interface)。 (虚拟)网络接口(interface)em1,也称为备用地址,因此,为了能够与服务进行通信,我首先必须创建一个套接字,将套接字绑定(bind)到与该接口(interface)关联的该地址,然后从此接口(interface)发送到服务,但是在代码中尝试仍然不可行。

请提供一些指导?希望能用Python进行一些套接字编程。

镜像到reddit comment

最佳答案

/etc/rd.conf中,将此行替换为:ifconfig_em1="inet6 dc20:c7f:2012:12::7 prefixlen 64"与此ifconfig_em1_ipv6="inet6 dc20:c7f:2012:12::7 prefixlen 64"
然后重新启动。

[root@dc20 ~]# ping6 -c 3 dc20:c7f:2012:12::7
PING6(56=40+8+8 bytes) dc20:c7f:2012:12::7 --> dc20:c7f:2012:12::7
16 bytes from dc20:c7f:2012:12::7, icmp_seq=0 hlim=64 time=0.290 ms
16 bytes from dc20:c7f:2012:12::7, icmp_seq=1 hlim=64 time=0.065 ms
16 bytes from dc20:c7f:2012:12::7, icmp_seq=2 hlim=64 time=0.070 ms

--- dc20:c7f:2012:12::7 ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.065/0.142/0.290/0.105 ms
[root@dc20 ~]#

完全可以。

09-07 08:15