Please check the picture here first, a visualization of my network plan.
I'm trying to add two networks on same Ubuntu 18 server, one of them is vlan tagged. When I add the second network, internal users can't access to this server from public IP. But anyone outside can access from public IP without any problem.
What I want to do
- I have default network 192.168.10.0/24 and a VLAN 300 tagged network 192.168.30.0/24.
- I want to add both 10.x and 30.x networks to one server, because I want it to access both networks.
- This server must be able to access both 192.168.10.0/24 and 192.168.30.0/24 networks.
- This server must be reachable from everywhere via its public IP.
Step by step what I do
- All wifi users are connect to 192.168.10.0/24 network.
- All servers are using VLAN 300 network 192.168.30.0/24.
- These servers are reachable via their Public IPs from internet. Internal wifi users can also access via these public IPs.
- When I add a second network to this ubuntu server, users can't access server via its public IP.
I tried many different things with netplan, and checked all the examples on netplan.io.
Here is my current simplest configuration:
network: ethernets: ens18: # this one is vlan tagged on Proxmox. So it can get 30.x IP. dhcp4: false addresses: [192.168.30.101/24] gateway4: 192.168.30.1 routes: - to: 192.168.30.0/24 via: 192.168.30.1 nameservers: addresses: [188.8.131.52, 184.108.40.206] ens19: dhcp4: false addresses: [192.168.10.101/24] # gateway4: 192.168.10.1 routes: - to: 192.168.10.0/24 via: 192.168.10.1 nameservers: addresses: [220.127.116.11, 18.104.22.168] version: 2
I also tried things using vlans:
network: ethernets: ens18: addresses: [192.168.10.101/24] # gateway4: 192.168.10.1 routes: - to: 192.168.10.0/24 via: 192.168.10.101 table: 5 - to: 0.0.0.0/0 via: 192.168.10.1 table: 5 routing-policy: - to: 192.168.10.0/24 table: 5 nameservers: addresses: [22.214.171.124, 126.96.36.199] vlans: vlan30: id: 300 link: ens18 gateway4: 192.168.30.1 addresses: [192.168.30.101/24] routes: - to: 192.168.30.0/24 via: 192.168.30.101 table: 6 - to: 0.0.0.0/0 via: 192.168.30.1 table: 6 routing-policy: - to: 192.168.30.0/24 table: 6 nameservers: addresses: [188.8.131.52, 184.108.40.206] version: 2 renderer: networkd