刚刚安装的Ubuntu和我的一个网卡端口不工作,也没有平它的IP - eno2。
在安装过程中配置的Netplan:
# This is the network config written by 'subiquity'
network:
ethernets:
eno1:
addresses:
- 11.22.33.210/24
- 1a2a:3a4a:5a6a:16::601/64
gateway4: 11.22.33.1
gateway6: 1a2a:3a4a:5a6a:16::1
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
- 8.8.8.8
- 8.8.4.4
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 2001:4860:4860::8888
- 2001:4860:4860::8844
accept-ra: no
eno2:
addresses:
- 22.33.44.210/24
- 1a2a:3a4a:5a6a:17::602/64
gateway4: 22.33.44.1
gateway6: 1a2a:3a4a:5a6a:17::1
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
- 8.8.8.8
- 8.8.4.4
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 2001:4860:4860::8888
- 2001:4860:4860::8844
accept-ra: no
eno3:
addresses:
- 33.44.55.210/24
- 1a2a:3a4a:5a6a:18::603/64
gateway4: 33.44.55.1
gateway6: 1a2a:3a4a:5a6a:18::1
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
- 8.8.8.8
- 8.8.4.4
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 2001:4860:4860::8888
- 2001:4860:4860::8844
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 2001:4860:4860::8888
- 2001:4860:4860::8844
accept-ra: no
eno4:
addresses:
- 44.55.66.210/24
- 1a2a:3a4a:5a6a:19::604/64
gateway4: 44.55.66.1
gateway6: 1a2a:3a4a:5a6a:19::1
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
- 8.8.8.8
- 8.8.4.4
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 2001:4860:4860::8888
- 2001:4860:4860::8844
accept-ra: no
version: 2运行了这个
echo 101 eno1-route >>/etc/iproute2/rt_tables
echo 102 eno2-route >>/etc/iproute2/rt_tables
echo 103 eno3-route >>/etc/iproute2/rt_tables
echo 104 eno4-route >>/etc/iproute2/rt_tablesrc.local
#!/bin/bash
# Increasing The Transmit Queue Length
/sbin/ifconfig eno1 txqueuelen 10000
/sbin/ifconfig eno2 txqueuelen 10000
/sbin/ifconfig eno3 txqueuelen 10000
/sbin/ifconfig eno4 txqueuelen 10000
/sbin/ifconfig lo txqueuelen 10000
#routes
ip route add default via 11.22.33.1 dev eno1 table eno1-route
ip rule add from 11.22.33.210 lookup eno1-route
ip route add default via 22.33.44.1 dev eno2 table eno2-route
ip rule add from 22.33.44.210 lookup eno2-route
ip route add default via 33.44.55.1 dev eno3 table eno3-route
ip rule add from 33.44.55.210 lookup eno3-route
ip route add default via 44.55.66.1 dev eno4 table eno4-route
ip rule add from 44.55.66.77 lookup eno4-route在应用netplan时获取此错误。
** (generate:5742): WARNING **: 05:13:22.079: Problem encountered while validating default route consistency.Please set up multiple routing tables and use `routing-policy` instead.
Error: Conflicting default route declarations for IPv4 (table: main, metric: default), first declared in eno2 but also in eno4重启后,所有的IPs -包括IPv4和IPv6 --似乎都是可点击的。怎么一回事?我已经有不同的路由表了。冲突的默认路由声明!?
ip route list返回
default via 22.33.44.1 dev eno2 proto static
default via 33.44.55.1 dev eno3 proto static
default via 11.22.33.1 dev eno1 proto static
default via 44.55.66.1 dev eno4 proto static
44.55.66.0/24 dev eno4 proto kernel scope link src 44.55.66.210
11.22.33.0/24 dev eno1 proto kernel scope link src 11.22.33.210
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
22.33.44.0/24 dev eno2 proto kernel scope link src 22.33.44.210
33.44.55.0/24 dev eno3 proto kernel scope link src 33.44.55.210 发布于 2022-01-12 22:10:18
您有不同的路由表,但是当您使用gateway4和gateway6速记时,这并不会使用那些路由表。要获得所需的结果,您需要将默认路由拼写为routes:,而不是https://netplan.io/reference/#default-routes中所描述的。
发布于 2022-08-02 17:28:40
“在应用netplan时获取此错误。
** (生成:5742):警告**:05:13:22.079:验证默认路由时遇到的问题,consistency.Please设置多个路由表并使用routing-policy。错误: IPv4的冲突默认路由声明(表: main,度量: default),首先在eno2中声明,但也在eno4中声明“
检查/etc/netplan文件夹中有多个YAML配置文件。
如果有多个文件,则清除单个文件可能会解决冲突。
我收到了这条错误消息,发现一个99- netplan文件与标准的00-installer-config.yaml文件相冲突。
删除99文件解决了问题。
https://askubuntu.com/questions/1386651
复制相似问题