Two network interfaces on ubuntu



Usage case

  • Have two network interfaces on my PC: 1 to local network (eno1) and 1 to public network (enx_fe) as above
  • Want to use eno1 for local trafic and enx_fe for internet access


  • Delete local defaul gateway + add route for local network
$ sudo ip route del default via dev eno1
$ sudo route add -net gw dev eno1
  • This means that: use eno1 for trafic on network and enx_fe for all others