Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Is there any Linux Deb command to export/save current ip link/route/... configuration and restore it later?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
postcd
Posts: 133
Joined: 2022-01-08 18:33
Has thanked: 48 times
Been thanked: 2 times

Is there any Linux Deb command to export/save current ip link/route/... configuration and restore it later?

#1 Post by postcd »

Hello,

I am on Debian 11 (bullseye - oldstable) with KDE.

Boring background:
I am required to add custom network interface and route: https://github.com/xjasonlyu/tun2socks/wiki/Examples
Why? Because beside my wg0 (Wireguard) tunnel which is used for all network traffic, I have used Wireguard to setup secondary wg1 interface (which is routing to different remote server). Now i want to use this secondary wg1 interface for my secondary web browser. tun2socks is supposed to help me do that. Yet it does not seem to setup routes/interface for me and as linked above i may need to do it manually.

Question:
Since i do not understand networking and is likely i will mess it, i want to ask if you can tell me the commands to A) backup and B) restore my current working network configuration before executing commands linked under URL above.
ip tuntap add ...
ip addr add ...
ip link set ...
ip route del ...
ip route add ...
I am unsure if "nmcli network off && nmcli network on" would reset the configuration. Thank you

Aki
Global Moderator
Global Moderator
Posts: 3082
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 76 times
Been thanked: 418 times

Re: Is there any Linux Deb command to export/save current ip link/route/... configuration and restore it later?

#2 Post by Aki »

postcd wrote: 2023-12-12 08:20 Question:
i want to ask if you can tell me the commands to A) backup and B) restore my current working network configuration before executing commands linked under URL above.

Code: Select all

ip tuntap add ...
ip addr add ...
ip link set ...
ip route del ...
ip route add ...
I am unsure if "nmcli network off && nmcli network on" would reset the configuration. Thank you
If you set up your computer's network configuration using the ifupdown package, you don't need to do this. The network configuration is stored in /etc/network/interfaces. You can easily back it up or restore it at any time. See in interfaces manual page [1] for further details.

---
[1] https://manpages.debian.org/bookworm/ifupdown/interfaces.5.en.html
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

postcd
Posts: 133
Joined: 2022-01-08 18:33
Has thanked: 48 times
Been thanked: 2 times

Re: Is there any Linux Deb command to export/save current ip link/route/... configuration and restore it later?

#3 Post by postcd »

No, I do not understand how to configure what was mentioned using ifupdown, including route, where (among other) that man page is not helpful to my level of understanding, and it raise numerous other questions. What is other way or example please?

Post Reply