Networking

無法在 1and1 專用伺服器上使用 CentOS6 靜態獲取 IPv6 設置

  • December 20, 2013

我在 1and1 有一台伺服器,我正在嘗試使用一組靜態 IPv6 地址進行設置。我無法讓它工作,並嘗試了我在Google上找到的每個論壇和指南。他們的技術支持告訴我網關是 fe80::1。我嘗試使用的 IPv6 地址已使用 1and1 控制面板進行配置,並已分配給我的帳戶。IPv4 網路已設置並且工作正常,我只需要有關 IPv6 的幫助。

下面是相關的配置文件:

貓 /etc/sysconfig/網路

NETWORKING=yes
NOZEROCONF=true
GATEWAY=10.255.255.1
NETWORKING_IPV6=yes
IPV6FORWARDING=yes
IPV6_AUTOCONF=no
IPV6_AUTOTUNNEL=no
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

貓 /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NAME=""
NM_CONTROLLED=no
MACADDR=""
MTU=1500
IPADDR=74.208.218.179
NETWORK=74.208.218.179
NETMASK=255.255.255.255
BROADCAST=74.208.218.179
IPV6INIT=yes
IPV6ADDR=2607:F1C0:812:7d10::/56
IPV6ADDR_SECONDARIES="2607:F1C0:812:7d10::1/56 2607:F1C0:812:7d10::2/56 2607:F1C0:812:7d11::/56"
IPV6FORWARDING=yes
IPV6_DEFAULTGW=fe80::1

我已經通過 sysctl 在核心中為 IPv4 和 IPv6 設置了轉發:

貓 /etc/sysctl.conf

net.ipv4.ip_forward=1
net.ipv4.tcp_syncookies=1
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.default.accept_source_route=0
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.all.autoconf = 0
kernel.shmmax=68719476736
kernel.msgmax=65536
kernel.msgmnb=65536
kernel.sysrq=0
kernel.shmall=4294967296
kernel.core_uses_pid=1

下面是一些命令的輸出:

如果配置

eth0    Link encap:Ethernet  HWaddr 00:19:99:27:2B:1D
       inet addr:74.208.218.179  Bcast:74.208.218.179  Mask:255.255.255.255
       inet6 addr: 2607:f1c0:812:7d11::/56 Scope:Global
       inet6 addr: 2607:f1c0:812:7d10::/56 Scope:Global
       inet6 addr: 2607:f1c0:812:7d10::1/56 Scope:Global
       inet6 addr: 2607:f1c0:812:7d10::2/56 Scope:Global
       inet6 addr: fe80::219:99ff:fe27:2b1d/64 Scope:Link
       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
       RX packets:542041826 errors:158 dropped:0 overruns:0 frame:158
       TX packets:517716410 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:1000
       RX bytes:55707235613 (51.8 GiB)  TX bytes:441496177225 (411.1 GiB)
       Interrupt:19 Base address:0xc000

eth0:0  Link encap:Ethernet  HWaddr 00:19:99:27:2B:1D
       inet addr:74.208.109.145  Bcast:74.208.109.145  Mask:255.255.255.255
       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
       Interrupt:19 Base address:0xc000

eth0:1  Link encap:Ethernet  HWaddr 00:19:99:27:2B:1D
       inet addr:74.208.125.133  Bcast:74.208.125.133  Mask:255.255.255.255
       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
       Interrupt:19 Base address:0xc000

eth0:2  Link encap:Ethernet  HWaddr 00:19:99:27:2B:1D
       inet addr:74.208.113.67  Bcast:74.208.113.67  Mask:255.255.255.255
       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
       Interrupt:19 Base address:0xc000

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:16436  Metric:1
       RX packets:2943936 errors:0 dropped:0 overruns:0 frame:0
       TX packets:2943936 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:0
       RX bytes:2949514917 (2.7 GiB)  TX bytes:2949514917 (2.7 GiB)

路由 -n -A inet6

Kernel IPv6 routing table
Destination                     Next Hop    Flags   Metric  Ref Use Iface
2607:f1c0:812:7d10::/56         ::          U       256     0   0   eth0
fe80::/64                       ::          U       256     0   0   eth0
::/0                            fe80::1     UG      1       45  0   eth0
::1/128                         ::          U       0       0   1   lo
2607:f1c0:812:7d10::/128        ::          U       0       12  1   lo
2607:f1c0:812:7d10::1/128       ::          U       0       0   1   lo
2607:f1c0:812:7d10::2/128       ::          U       0       0   1   lo
2607:f1c0:812:7d11::/128        ::          U       0       2   1   lo
fe80::/128                      ::          U       0       0   1   lo
fe80::219:99ff:fe27:2b1d/128    ::          U       0       9   1   lo
ff00::/8                        ::          U       256     0   0   eth0

使用此設置,我可以 ping 預設網關,但不能 ping 1and1 網路之外的任何內容:

ping6 fe80::1 -I eth0

64 bytes from fe80::1: icmp_seq=1 ttl=64 time=0.442 ms
64 bytes from fe80::1: icmp_seq=2 ttl=64 time=0.447 ms
64 bytes from fe80::1: icmp_seq=3 ttl=64 time=0.450 ms
^C

ping6 ipv6.google.com

PING ipv6.google.com(ord08s12-in-x14.1e100.net) 56 data bytes
^C
--- ipv6.google.com ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 6052ms

Traceroute6 給出以下輸出:

traceroute6 ipv6.google.com

traceroute to ipv6.google.com (2607:f8b0:4009:806::1014), 30 hops max, 80 byte packets
1  ae-1.gw-prtr-r5-2a.slr.lxa.oneandone.net (2607:f1c0:0:10::66:a)  0.819 ms  0.944 ms  1.073 ms
2  * * *
3  * * *
4  * * *
5  * * *
6  * * *
7  * * *
8  * * *
9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

網關是 fe80::1 而我的 ipv6 地址是 2607:f1c0:812:… 的問題?由於我的 IP (74.208 … ) 與網關 (10.255.255.1) 位於不同的子網上,因此我確實無法讓 IPv4 設置正常工作。


*旁注:*如果它可以幫助 1and1 伺服器上的其他任何人,對於 IPv4,您需要像這樣修改 /etc/sysconfig/network-scripts/route-eth0 :

貓 /etc/sysconfig/network-scripts/route-eth0

ADDRESS0=10.255.255.1
GATEWAY0=""
NETMASK0=255.255.255.255
ADDRESS1=0.0.0.0
GATEWAY1=10.255.255.1
NETMASK1=0.0.0.0

設置是正確的。對於其他擁有 1and1 專用伺服器的人來說,我能獲得任何流量的唯一方法是通過他們的控制面板完全停用 1and1 IPv6 防火牆。修改規則並沒有什麼不同。

引用自:https://serverfault.com/questions/562561