
저는 3개의 nic 어댑터를 사용하여 기계를 만들었습니다. 구성된 네트워크 내에서는 모든 것이 작동하지만 라우팅이 올바르게 작동하지 않는 것 같습니다.
ping 8.8.8.8
ping: connect: Network is unreachable
내 구성은 다음과 같습니다.
/etc/netplan/00-installer-config.yaml :
network:
version: 2
ethernets:
ens160:
addresses:
- 172.16.1.114/16
match:
macaddress: 00:50:56:aa:00:1d
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: produzione
routes:
- to: 0.0.0.0/0
via: 172.16.1.1
table: 60
routing-policy:
- from: 172.16.1.114
table: 60
priority: 300
ens192:
addresses:
- 172.21.2.114/16
match:
macaddress: 00:50:56:aa:6f:ed
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: qa
routes:
- to: 0.0.0.0/0
via: 172.21.1.1
table: 61
routing-policy:
- from: 172.21.2.114
table: 61
priority: 300
ens224:
addresses:
- 172.21.1.114/16
match:
macaddress: 00:50:56:aa:16:92
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: sviluppo
routes:
- to: 0.0.0.0/0
via: 172.21.1.1
table: 62
routing-policy:
- from: 172.21.1.114
table: 62
priority: 300
/etc/iproute2/rt_tables.d/swarm.conf :
# produzione
60 60
# qa
61 61
# sviluppo
62 62
어떤 도움이라도 대단히 감사하겠습니다.
답변1
0.0.0.0에 도달하기 위해 각 인터페이스에 대한 라우팅 정책을 잊어버렸습니다.
예:
routing-policy:
- from: 172.16.1.114
table: 60
- to: 0.0.0.0/0
table: 60
내 경우의 전체 구성은 다음과 같습니다.
network:
version: 2
ethernets:
ens160:
dhcp4: no
addresses:
- 172.16.1.114/16
match:
macaddress: 00:50:56:aa:00:1d
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: produzione
routes:
- to: 0.0.0.0/0
via: 172.16.1.1
table: 60
routing-policy:
- from: 172.16.1.114
table: 60
- to: 0.0.0.0/0
table: 60
ens192:
dhcp4: no
addresses:
- 172.21.2.114/16
match:
macaddress: 00:50:56:aa:6f:ed
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: qa
routes:
- to: 0.0.0.0/0
via: 172.21.1.1
table: 61
routing-policy:
- from: 172.21.2.114
table: 61
- to: 0.0.0.0/0
table: 61
ens224:
dhcp4: no
addresses:
- 172.21.1.114/16
match:
macaddress: 00:50:56:aa:16:92
nameservers:
addresses:
- 172.16.1.11
- 172.16.1.20
search:
- domain.com
set-name: sviluppo
routes:
- to: 0.0.0.0/0
via: 172.21.1.1
table: 62
routing-policy:
- from: 172.21.1.114
table: 62
- to: 0.0.0.0/0
table: 62