Yet Another Netplan Question
up vote
0
down vote
favorite
having trouble getting my head around netplan.
I have 2 interfaces: ens18 & 19. ens18 is connected to my external network, ens19 connected internally.
I want all internet bound traffic to go out via ens18, however, it always goes out via ens19.
I set the DHCP metric on ens19 to 200, hoping that would resolve it, but no luck.
Here's my 50-cloud-init.yaml
network:
ethernets:
ens18:
addresses:
dhcp4: true
ens19:
addresses:
dhcp4: true
routes:
- to: 10.0.0.0/24
via: 10.100.0.254
metric: 100
table: 101
- to: 10.0.1.0/24
via: 10.100.0.254
metric: 100
table: 101
routing-policy:
- from: 10.0.0.0/24
table: 101
- from: 10.0.1.0/24
table: 101
version: 2
My 10-netplan-ens18.network
[Match]
Name=ens18
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
And my 10-netplan-ens19.network
[Match]
Name=ens19
[Network]
DHCP=ipv4
[Route]
Destination=10.0.0.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[Route]
Destination=10.0.1.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[RoutingPolicyRule]
From=10.0.0.0/24
Table=101
[RoutingPolicyRule]
From=10.0.1.0/24
Table=101
[DHCP]
UseMTU=true
RouteMetric=200
You'll notice that I added some static routes on ens19. This is because, when I copied the intial ens19 config file to /etc/systemd/network (without the static routes) the internet-bound traffic did go out via ens18, but I wasn't able to connect to the ens19 interface from my internal network (my laptop is on a different subnet to the server)
My ip route output is
default via 10.100.0.254 dev ens19 proto dhcp src 10.100.0.13 metric 100
default via 10.1.2.254 dev ens18 proto dhcp src 10.1.2.3 metric 100
10.1.2.0/24 dev ens18 proto kernel scope link src 10.1.2.3
10.1.2.254 dev ens18 proto dhcp scope link src 10.1.2.3 metric 100
10.100.0.0/24 dev ens19 proto kernel scope link src 10.100.0.13
10.100.0.254 dev ens19 proto dhcp scope link src 10.100.0.13 metric 100
And ip rule is
0: from all lookup local
0: from 10.0.0.0/24 lookup 101
0: from 10.0.1.0/24 lookup 101
32766: from all lookup main
32767: from all lookup default
TL;DR
I have an 18.04 server with 2 NICs, both assigned an address via DHCP (I'd rather keep it that way) but am unable to define both the default route to 0.0.0.0/0 and access the second interface from my internal network.
Hope someone can help here. I found it much easier to do this with 16.04 and previous.
18.04 netplan
New contributor
add a comment |
up vote
0
down vote
favorite
having trouble getting my head around netplan.
I have 2 interfaces: ens18 & 19. ens18 is connected to my external network, ens19 connected internally.
I want all internet bound traffic to go out via ens18, however, it always goes out via ens19.
I set the DHCP metric on ens19 to 200, hoping that would resolve it, but no luck.
Here's my 50-cloud-init.yaml
network:
ethernets:
ens18:
addresses:
dhcp4: true
ens19:
addresses:
dhcp4: true
routes:
- to: 10.0.0.0/24
via: 10.100.0.254
metric: 100
table: 101
- to: 10.0.1.0/24
via: 10.100.0.254
metric: 100
table: 101
routing-policy:
- from: 10.0.0.0/24
table: 101
- from: 10.0.1.0/24
table: 101
version: 2
My 10-netplan-ens18.network
[Match]
Name=ens18
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
And my 10-netplan-ens19.network
[Match]
Name=ens19
[Network]
DHCP=ipv4
[Route]
Destination=10.0.0.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[Route]
Destination=10.0.1.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[RoutingPolicyRule]
From=10.0.0.0/24
Table=101
[RoutingPolicyRule]
From=10.0.1.0/24
Table=101
[DHCP]
UseMTU=true
RouteMetric=200
You'll notice that I added some static routes on ens19. This is because, when I copied the intial ens19 config file to /etc/systemd/network (without the static routes) the internet-bound traffic did go out via ens18, but I wasn't able to connect to the ens19 interface from my internal network (my laptop is on a different subnet to the server)
My ip route output is
default via 10.100.0.254 dev ens19 proto dhcp src 10.100.0.13 metric 100
default via 10.1.2.254 dev ens18 proto dhcp src 10.1.2.3 metric 100
10.1.2.0/24 dev ens18 proto kernel scope link src 10.1.2.3
10.1.2.254 dev ens18 proto dhcp scope link src 10.1.2.3 metric 100
10.100.0.0/24 dev ens19 proto kernel scope link src 10.100.0.13
10.100.0.254 dev ens19 proto dhcp scope link src 10.100.0.13 metric 100
And ip rule is
0: from all lookup local
0: from 10.0.0.0/24 lookup 101
0: from 10.0.1.0/24 lookup 101
32766: from all lookup main
32767: from all lookup default
TL;DR
I have an 18.04 server with 2 NICs, both assigned an address via DHCP (I'd rather keep it that way) but am unable to define both the default route to 0.0.0.0/0 and access the second interface from my internal network.
Hope someone can help here. I found it much easier to do this with 16.04 and previous.
18.04 netplan
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
having trouble getting my head around netplan.
I have 2 interfaces: ens18 & 19. ens18 is connected to my external network, ens19 connected internally.
I want all internet bound traffic to go out via ens18, however, it always goes out via ens19.
I set the DHCP metric on ens19 to 200, hoping that would resolve it, but no luck.
Here's my 50-cloud-init.yaml
network:
ethernets:
ens18:
addresses:
dhcp4: true
ens19:
addresses:
dhcp4: true
routes:
- to: 10.0.0.0/24
via: 10.100.0.254
metric: 100
table: 101
- to: 10.0.1.0/24
via: 10.100.0.254
metric: 100
table: 101
routing-policy:
- from: 10.0.0.0/24
table: 101
- from: 10.0.1.0/24
table: 101
version: 2
My 10-netplan-ens18.network
[Match]
Name=ens18
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
And my 10-netplan-ens19.network
[Match]
Name=ens19
[Network]
DHCP=ipv4
[Route]
Destination=10.0.0.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[Route]
Destination=10.0.1.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[RoutingPolicyRule]
From=10.0.0.0/24
Table=101
[RoutingPolicyRule]
From=10.0.1.0/24
Table=101
[DHCP]
UseMTU=true
RouteMetric=200
You'll notice that I added some static routes on ens19. This is because, when I copied the intial ens19 config file to /etc/systemd/network (without the static routes) the internet-bound traffic did go out via ens18, but I wasn't able to connect to the ens19 interface from my internal network (my laptop is on a different subnet to the server)
My ip route output is
default via 10.100.0.254 dev ens19 proto dhcp src 10.100.0.13 metric 100
default via 10.1.2.254 dev ens18 proto dhcp src 10.1.2.3 metric 100
10.1.2.0/24 dev ens18 proto kernel scope link src 10.1.2.3
10.1.2.254 dev ens18 proto dhcp scope link src 10.1.2.3 metric 100
10.100.0.0/24 dev ens19 proto kernel scope link src 10.100.0.13
10.100.0.254 dev ens19 proto dhcp scope link src 10.100.0.13 metric 100
And ip rule is
0: from all lookup local
0: from 10.0.0.0/24 lookup 101
0: from 10.0.1.0/24 lookup 101
32766: from all lookup main
32767: from all lookup default
TL;DR
I have an 18.04 server with 2 NICs, both assigned an address via DHCP (I'd rather keep it that way) but am unable to define both the default route to 0.0.0.0/0 and access the second interface from my internal network.
Hope someone can help here. I found it much easier to do this with 16.04 and previous.
18.04 netplan
New contributor
having trouble getting my head around netplan.
I have 2 interfaces: ens18 & 19. ens18 is connected to my external network, ens19 connected internally.
I want all internet bound traffic to go out via ens18, however, it always goes out via ens19.
I set the DHCP metric on ens19 to 200, hoping that would resolve it, but no luck.
Here's my 50-cloud-init.yaml
network:
ethernets:
ens18:
addresses:
dhcp4: true
ens19:
addresses:
dhcp4: true
routes:
- to: 10.0.0.0/24
via: 10.100.0.254
metric: 100
table: 101
- to: 10.0.1.0/24
via: 10.100.0.254
metric: 100
table: 101
routing-policy:
- from: 10.0.0.0/24
table: 101
- from: 10.0.1.0/24
table: 101
version: 2
My 10-netplan-ens18.network
[Match]
Name=ens18
[Network]
DHCP=ipv4
[DHCP]
UseMTU=true
RouteMetric=100
And my 10-netplan-ens19.network
[Match]
Name=ens19
[Network]
DHCP=ipv4
[Route]
Destination=10.0.0.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[Route]
Destination=10.0.1.0/24
Gateway=10.100.0.254
Metric=100
Table=101
[RoutingPolicyRule]
From=10.0.0.0/24
Table=101
[RoutingPolicyRule]
From=10.0.1.0/24
Table=101
[DHCP]
UseMTU=true
RouteMetric=200
You'll notice that I added some static routes on ens19. This is because, when I copied the intial ens19 config file to /etc/systemd/network (without the static routes) the internet-bound traffic did go out via ens18, but I wasn't able to connect to the ens19 interface from my internal network (my laptop is on a different subnet to the server)
My ip route output is
default via 10.100.0.254 dev ens19 proto dhcp src 10.100.0.13 metric 100
default via 10.1.2.254 dev ens18 proto dhcp src 10.1.2.3 metric 100
10.1.2.0/24 dev ens18 proto kernel scope link src 10.1.2.3
10.1.2.254 dev ens18 proto dhcp scope link src 10.1.2.3 metric 100
10.100.0.0/24 dev ens19 proto kernel scope link src 10.100.0.13
10.100.0.254 dev ens19 proto dhcp scope link src 10.100.0.13 metric 100
And ip rule is
0: from all lookup local
0: from 10.0.0.0/24 lookup 101
0: from 10.0.1.0/24 lookup 101
32766: from all lookup main
32767: from all lookup default
TL;DR
I have an 18.04 server with 2 NICs, both assigned an address via DHCP (I'd rather keep it that way) but am unable to define both the default route to 0.0.0.0/0 and access the second interface from my internal network.
Hope someone can help here. I found it much easier to do this with 16.04 and previous.
18.04 netplan
18.04 netplan
New contributor
New contributor
New contributor
asked Nov 22 at 16:49
user895905
1
1
New contributor
New contributor
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
user895905 is a new contributor. Be nice, and check out our Code of Conduct.
user895905 is a new contributor. Be nice, and check out our Code of Conduct.
user895905 is a new contributor. Be nice, and check out our Code of Conduct.
user895905 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095157%2fyet-another-netplan-question%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown