0

Does anyone know how to make the following command permanent in Elementary OS?

route add -host 192.168.1.1 dev wlp0s20f3

This route does exactly what I need, but its not permanent. A reboot of the machine or the network connection will result in it being removed from the IP tables.

I can't seem to find the files that define the routes for this device (wifi adapter - wlp0s20f3).

  • Have you tried it with the -p switch? route -p add – Oberleutnant20 Jul 13 at 13:55
  • Google is your friend. networkinghowtos.com/howto/… – Sysadmin Jul 16 at 18:17
  • linoxide.com/how-tos/… See the section for Ubuntu. Elementary OS is based in Ubuntu. – Sysadmin Jul 16 at 18:20
  • Hi guys - the problem is not how to construct the route, it's that it's temporary. This route works fine. But if i disable/enable the network adapter this route gets removed from the iptables. How can i make this route permanent? (will edit question to make this more clear) – BlackSpy Jul 17 at 7:32
  • @Oberleutnant20 I don't see a -p switch listed as an option for route. Is there is link you can share that explains this? – BlackSpy Jul 17 at 7:39
1

Type in terminal :

sudo nano /etc/network/interfaces

Add at the bottom this:

up route add -net 192.168.1.10/24 gw 192.168.1.1 dev wlp0s20f3

Where 192.168.1.10 is the IP of your machine which you can check with command:

ip a

Restart the networking service by typing in terminal:

sudo /etc/init.d/networking restart
| improve this answer | |
  • Thanks so much Sysadmin! it was the up at the front that i was missing :) – BlackSpy Jul 17 at 7:43

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.