LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-25-2022, 12:03 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,689
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
making an added route be permanent


i have added a route (a default route, actually) to my route table with the "ip route add default ..." command. the route works for about a few minutes then disappears and is no longer in the table. how can i make a manually entered route stay in place until the system goes down?

Last edited by Skaperen; 12-25-2022 at 12:04 AM.
 
Old 12-25-2022, 03:43 AM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 984

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
It depends. Is it a systemd abomination? If yes, persistent routes should be added in the [route] section of systemd-networkd configuration. Read, despair and beware of many bugs which definitely and categorically are present in systemd-networkd handling of static-dynamic route mix. https://wiki.archlinux.org/title/systemd-networkd
 
1 members found this post helpful.
Old 12-25-2022, 12:08 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,689

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
it is Ubuntu 20.04 LTS so it does run systemd.

what is going on.

i have added other routes that are not default routes via my script that starts up my VPN. those routes all work fine. when i reboot, they get added, again, when my script starts the VPN. the route that just disappears after a few minutes is manually added. really manually. i type it in. it works exactly as intended and expected until it disappears in a few minutes. it is manual because it is for testing. i want to test how a certain website behaves when traffic comes from a different IP address.

i want my manual route table entry to stay until i reboot or manually delete it or override it with a lower metric (have done that before and it works). i don't want to have to reconfigure something. it should lose what i manually do with just doing only a reboot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Linux - Networking 2 10-11-2017 02:58 PM
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Red Hat 1 10-09-2017 05:45 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
Adding route and making ifconfig permanent gani *BSD 9 09-21-2004 02:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration