有人能提供一些提示,说明为什么 ab 无法在 ipv6 客户端/服务器配置上工作,而 ipv4 运行良好?
提前致谢
==
客户端配置:
Apache 基准测试详细信息:
root@VM8-4:~# dpkg -l | egrep apache
ii apache2-utils 2.2.22-1ubuntu1.3 utility programs for webservers
root@VM8-4:~# ab -n 1 -c 1 http://[2607:f0d0:2001:a0b:c0d:e0f:1011:1213]/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 2607:f0d0:2001:a0b:c0d:e0f:1011:1213 (be patient)...
Test aborted after 10 failures
apr_socket_connect(): Network is unreachable (101)
root@VM8-4:~# ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2607:f0d0:2001:a0b:c0d:e0f:1011:1210/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe50:113f/64 scope link
valid_lft forever preferred_lft forever
root@VM8-4:~# ip -6 r s
2607:f0d0:2001:a0b:c0d:e0f:1011:1210 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
root@VM8-4:~# cat /proc/version
Linux version 3.2.0-29-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012
root@VM8-4:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.10.0.84
netmask 255.255.255.0
network 10.10.0.0
broadcast 10.10.0.255
gateway 10.10.0.100
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.10.0.100
### Start IPV6 static configuration
iface eth0 inet6 static
pre-up modprobe ipv6
address 2607:f0d0:2001:0a0b:0c0d:0e0f:1011:1210
netmask 128
gateway 2607:f0d0:2001:0a0b:0000:0000:0000:0001
### END IPV6 configuration
root@VM8-4:~#
root@VM8-4:~# netstat -punta | egrep -nir 'tcp6|80'
10:tcp6 0 0 :::2022 :::* LISTEN 8122/sshd
root@VM8-4:~#
服务器配置:
root@VM8-6:/opt# netstat -punta | egrep -nir 'tcp6|80'
3:tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30343/apache2
9:tcp6 0 0 2607:f0d0:2001:a0b:c:80 :::* LISTEN 30343/apache2
10:tcp6 0 0 :::22 :::* LISTEN 1705/sshd
root@VM8-6:/opt# ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2607:f0d0:2001:a0b:c0d:e0f:1011:1213/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:feaa:d676/64 scope link
valid_lft forever preferred_lft forever
root@VM8-6:/opt# ip -6 r s
2607:f0d0:2001:a0b:c0d:e0f:1011:1213 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
root@VM8-6:/opt# netstat -punta | egrep -nir 'tcp6'
9:tcp6 0 0 2607:f0d0:2001:a0b:c:80 :::* LISTEN 29557/apache2
10:tcp6 0 0 :::22 :::* LISTEN 1705/sshd
root@VM8-6:/opt#
root@VM8-6:/opt# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.10.0.86
netmask 255.255.255.0
network 10.10.0.0
broadcast 10.10.0.255
gateway 10.10.0.100
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.10.0.100
### Start IPV6 static configuration
iface eth0 inet6 static
pre-up modprobe ipv6
address 2607:f0d0:2001:0a0b:0c0d:0e0f:1011:1213
netmask 128
gateway 2607:f0d0:2001:0a0b:0000:0000:0000:0001
### END IPV6 configuration
root@VM8-6:/opt# cat /proc/version
Linux version 3.2.0-29-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012
网关:
root@Slot1:~# ip -6 a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2607:f0d0:2001:a0b::1/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a61f:72ff:fec6:8201/64 scope link
valid_lft forever preferred_lft forever
60: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qlen 1000
inet6 fe80::861b:5eff:fe9d:983c/64 scope link
valid_lft forever preferred_lft forever
root@Slot1:~# ip -6 r s
2607:f0d0:2001:a0b::1 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev wlan1 proto kernel metric 256
root@Slot1:~#
答案1
你们所有的系统都有一个/128
面具,而它们应该有/64
掩码。仅适用/128
于本地主机。
在 Debian 配置中,您应该更改:
netmask 128
到
netmask 64