I have a Ubuntu device connected to two different networks:

  • enp3s0 (, wired and connected to a local network (no access to internet)
  • wlp4s0 (, wireless and connected to internet.

I would like every packets with destination go through the enp3s0 interface, whereas all other packets go with wlp4s0 interface.

How can I do that?

In my route table I have two default routes:

default via dev enp3s0  proto static  metric 100
default via dev wlp4s0  proto static  metric 600



As long as you have the correct netmasks set on the interfaces, locally destination packets will "do the right thing".

To get "everything else" to go out the wlp4s0 interface, you will need to remove the default route pointing to the enp3s0 interface.

  • I'm connected to the device with SSH using the local network (so with enp3s0 interface). If I delete the default route to this interface, i'm not able to connect with SSH anymore.. Also, if I reboot the device, this route is going back as default with the other to wlp4s0
    – iAmoric
    Dec 18 '19 at 9:29
  • What is your SSH client IP? If it were in the enp3s0 net, you would not need additional routes. Dec 18 '19 at 14:57
  • Yes it's enp3s0. The SSH client is in the network
    – iAmoric
    Dec 19 '19 at 8:15

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.