0

I'm trying to setup a virtual interface on a 20.04 instance that can route to the internet.

vlan 66 is working and is accessible by other devices that are strictly on that vlan. VLAN 66's Gateway is 192.168.66.1 (pfsense) and is a /24 network.

This adds a proper vlan 66 (192.168.66.3) to the VM. However I cannot ping this device from any other vlan 66 device. Do I have the routing incorrect?

Netplan:

network:
  version: 2
  ethernets:
    ens160:
      dhcp4: false
      addresses: [192.168.1.3/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [192.168.1.2,1.1.1.1]
    ens66: {}

vlans: vlan.66: id: 66 link: ens160 addresses: [192.168.66.3/24] routes: - to: 0.0.0.0/0 via: 192.168.1.1 metric: 100

awm
  • 198

1 Answers1

1

this configuration contains 2 default routes. But you see only one in your routing table

ip route

In your case it is even worse the gateway used in the vlan.66 route is not part of the local vlan.66 network. This will never work.

Options:

  1. Remove the second default route and use more specific network routes

Off the Record: Replace

gateway4: 192.168.1.1

By

routes:
            - to: 0.0.0.0/0
              via: 192.168.1.1
dummyuser
  • 1,088