问题描述
我有一个多 VLAN 设置(单物理网卡)和每个 VLAN 上的网关。我的设置中需要多个网关。我以为我设置正确,但仍有一些东西坏了。 这是我的网络计划:
network:
version: 2
renderer: networkd
ethernets:
enp134s0f1:
addresses: ["10.22.83.11/24"]
dhcp4: no
routes:
- to: 0.0.0.0/0
via: 10.22.83.1
metric: 100
nameservers:
addresses: [10.22.30.15]
vlans:
vlan285:
id: 285
link: enp134s0f1
addresses: ["10.22.85.11/24"]
routes:
- to: 0.0.0.0/0
via: 10.22.85.1
metric: 285
vlan286:
id: 286
link: enp134s0f1
addresses: ["10.22.86.11/24"]
routes:
- to: 0.0.0.0/0
via: 10.22.86.1
metric: 286
vlan287:
id: 287
link: enp134s0f1
addresses: ["10.22.87.11/24"]
routes:
- to: 0.0.0.0/0
via: 10.22.87.1
metric: 287
来自虚拟接口 vlan285 的 Ping 通过并得到响应,但它们似乎被过滤了。举个例子:
# tcpdump -nn -i any icmp &
[1] 64743
tcpdump: verbose output suppressed,use -v or -vv for full protocol decode
listening on any,link-type LINUX_SLL (Linux cooked),capture size 262144 bytes
# ping -I 10.22.85.11 10.22.30.15
PING 10.22.30.15 (10.22.30.15) from 10.22.85.11 : 56(84) bytes of data.
08:47:29.757827 IP 10.22.85.11 > 10.22.30.15: ICMP echo request,id 65175,seq 1,length 64
08:47:29.758322 ethertype IPv4,IP 10.22.30.15 > 10.22.85.11: ICMP echo reply,length 64
08:47:29.758322 IP 10.22.30.15 > 10.22.85.11: ICMP echo reply,length 64
08:47:30.760594 IP 10.22.85.10 > 10.22.30.15: ICMP echo request,seq 2,length 64
我尝试注释掉其中一个接口的配置并使用 /etc/iproute2/rt_tables 方法(此处提供的示例步骤 https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System )重新配置它。结果与 netplan 相同。
我还全局禁用了 arp_filter 和 rp_filter。我还看到一些人建议启用记录火星数据包,所以我这样做并得到了这个:
kernel: [5751248.047497] IPv4: martian source 10.22.86.11 from 10.22.86.2,on dev br286
kernel: [5751248.047538] ll header: 00000000: ff ff ff ff ff ff 80 e0 1d cf d6 bf 08 06 ..............
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)