I'm trying to set up a server with 192.... addresses that is able to access the outside world using the gateway provided by my colo. I'm looking at the "Directly connected gateway" example at https://netplan.io/examples#directly-connected-gateway
I also have looked at and tried:
(but the second one is so obfuscated that I can't figure it out...)
My colo provided gateway is 220.127.116.11. I want anything on the outside world to go through it. I guess I probably don't want things on local networks like 192..., 10..., etc to go through the gateway.
But if what I'm doing is possible I'll just set up another gateway.
Here's what I have so far that doesn't work, where I try to get the eno2 interface to go through the gateway:
network: version: 2 renderer: networkd ethernets: eno1: addresses: [192.168.1.10/24] gateway4: 192.168.1.20 dhcp4: no nameservers: addresses: [18.104.22.168, 22.214.171.124] eno2: addresses: [192.168.1.11/24] #gateway4: 192.168.1.20 dhcp4: no nameservers: addresses: [126.96.36.199, 188.8.131.52] routes: - to: 0.0.0.0/0 via: 184.108.40.206 on-link: true
then I test it with a ping on that eno2 interface:
decker@dbu2:~$ ping -I eno2 220.127.116.11 PING 18.104.22.168 (22.214.171.124) from 192.168.1.11 eno2: 56(84) bytes of data. ^C --- 126.96.36.199 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2043ms
The reason I'm doing this is because my gateway at 192.168.1.20 went down, and rather than set up another gateway I'd like it if this server could just connect to the outside world on its own.