I have an Ubuntu Laptop that has an ethernet interface and a wireless interface. The Ethernet interface is connected to the corporate network while the wireless network is open. All the machines/servers and applications on corporate network use a set of dns suffixes. When I'm connected to both interfaces, the Ethernet takes priority and I'm able to connect all intranet machines/applications, but not to anything outside the intranet via the wifi adapter. What I'd like to do is to achieve:

  1. Connect to both the interfaces at the same time and route traffic to intranet or internet based on domain suffix e.g. google.com should be routed via the wifi adapter and mycompany.domain should be routed via the ethernet adapter.
  2. Ensure the routing rules are only applied based on certain conditions:
    1. The intranet/corporate routing should apply on certain named profile (Not sure if this is possible)
    2. The wifi settings should only apply if I'm connected to certain SSID/Network

I tried the following configuration using NetPlan but for some reason its not routing traffic to the corporate intranet:

  version: 2
  renderer: networkd
      dhcp4: true
      optional: true
      gateway4: aa.aa.dd.asd
          search: [subdomain1.corporate.domain, subdomain2.corporate.domain, subdomain3.corporate.domain]
          addresses: [xx.yy.zz.c,aa.bb.cc.d]
      optional: true
      dhcp4: yes
          password: "MyPassword"
      gateway4: aa.bb.cc.dd
        addresses: [ee.ff.gg.hh]

I could not find any rule definition to match on the profile name. Any help will be greatly appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.