Welcome to the Linux Foundation Forum!

Netplan error for two interfaces.

Hi.

I was practising netplan by using my laptop to act as a router with two interfaces attached to it. Each interface is connect to a different router. I have router-1 which is the 192.168.1.0/24 network and router-2 which is the 192.168.0.0/24 network. router-2 has internet access.

Now after an Ubuntu update 'Gateway4' is now deprecated and when I try to setup two interfaces using 'routes' it is not working.

I have done this many times using 'gateway4' and it's worked fine but with 'routes' it is not working. The netplan file loads OK and I can see each interface with it's own static IP address but there is a big error here as I can't even ping from another PC within the same network to this laptop - it says 'host unreachable'. The internet works fine.

Here is the yaml file - I have removed my SSID's and passwords just in case:

network:
version: 2
renderer: networkd
wifis:
wlp1s0:
dhcp4: no
dhcp6: no
addresses: [192.168.1.25/24]
nameservers:
addresses: [192.168.1.1, 8.8.8.8]
access-points:
router-1:
password: password
routes:
- to: default
via: 192.168.1.1
wlx10feed22f2da:
dhcp4: no
dhcp6: no
addresses: [192.168.0.30/24]
nameservers:
addresses: [192.168.0.1, 8.8.8.8]
access-points:
router-2:
password: password
routes:
- to: 192.168.0.0/24
via: 192.168.0.1

I must be missing something out. Can anyone help?
Thanks.

Answers

Categories

Upcoming Training