IPv6删除路由

IPv6删除路由

前段时间我玩弄了 IPv6 路由,但我搞混了:) 那是我的路由表

root@banana:~# route -6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
2a02:c7d:ca1b:6d00::/64        ::                         UAe  256 0     0 eth0
2a02:c7d:ca1b:6d01::/64        ::                         UAe  256 0     0 eth0
fe80::/64                      ::                         U    256 0     0 eth0
::/0                           ::                         U    1   0     0 eth0
::/0                           fe80::20f:34ff:feac:fa49   UGDAe 1024 0     0 eth0
::/0                           ::                         !n   -1  1 73439 lo
::1/128                        ::                         Un   0   1 15647 lo
2a02:c7d:ca1b:6d00:d250:99ff:fe53:f2fc/128 ::                         Un   0   1  3615 lo
2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc/128 ::                         Un   0   1   678 lo
fe80::d250:99ff:fe53:f2fc/128  ::                         Un   0   1 17417 lo
ff00::/8                       ::                         U    256 0     0 eth0
::/0                           ::                         !n   -1  1 73439 lo

基本上,我只想要针对 eth0 的默认设置,并删除剩余的针对环回的设置

当我尝试删除它们时出现此错误

root@banana:~# route -A inet6 del default via fe80::20f:34ff:feac:fa49
Usage: inet6_route [-vF] del Target
       inet6_route [-vF] add Target [gw Gw] [metric M] [[dev] If]
       inet6_route [-FC] flush      NOT supported
root@banana:~# route -A  inet6_route del default via fe80::20f:34ff:feac:fa49
Unknown address family `inet6_route'.

现在,我想清理我的路由表,因为我的服务器似乎没有路由

root@banana:~# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
From 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc icmp_seq=1 Destination unreachable: Address unreachable
From 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc icmp_seq=2 Destination unreachable: Address unreachable
From 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc icmp_seq=5 Destination unreachable: Address unreachable
From 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc icmp_seq=6 Destination unreachable: Address unreachable
From 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc icmp_seq=7 Destination unreachable: Address unreachable
^C
--- 2001:4860:4860::8888 ping statistics ---
10 packets transmitted, 0 received, +5 errors, 100% packet loss, time 8999ms

有什么建议吗?

答案1

我会尝试

ip -6 route del 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc dev lo0

或者

route -A inet6 del 2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc

显然2a02:c7d:ca1b:6d01:d250:99ff:fe53:f2fc是外部主机(mac 是d0:50:90:53:f2:fc),其流量不应路由到lo0

相关内容