As per the subject, how can I bounce a ppp0 connection? I need to do this in a script so that when the connection gets interrupted it will automatically reconnect. When my dynamic IP address from the ISP changes, as it does most days, the pppo connection can remain active but I can lose internet connectivity, necessitating the bounce. This was never an issue in the past but certainly has been since using the new style network configurations.
What I’ve been using in the past is and what I need to functionally replicate is:
sub bounce_ppoe {
`ifdown ppp0`;
sleep 2;
`ifup ppp0`;
}
I tried using nmcli con down and up but that didn’t work. On “nmcli con down ppp0” I get “Error: ‘ppp0’ is not an active connection. Error: no active connection provided”. On “nmicli con up ppp0” I get “Error: unknown connection ‘ppp0’”.
When the connection is up and I have internet connectivity, “nmcli” lists the NIC interfaces but for the ppp0 is says “ppp0: disconnected”, whereas ifconfig or ip each show it connected, as expected.
The pppo interface was created using nmtui and that works fine for disconnecting and reconnecting but, as fas as I’m aware, it can’t be used in a script, so what can I use?
A reboot will certainly fix the connection but after every reboot I need to check a few things tell rkhunter and tripwire to accept the changes they detect as a consequence of the reboot, because they can’t tell the difference between that and a system compromise. Clearly not an ideal solution.
BTW, this is on the firewall VM for my home network, so having that ppp0 connection up and functioning is pretty important to us.
For background: I’m very new to Rocky, having used Centos7 right up till the start of this month. As a consequence, almost everything I knew about setting up and managing a server is obsolete and the tools and methods I’ve been using for decades no longer work. To make matters worse, I’ve been retired for a number of years and no longer have access to other IT department team members to discuss these things with. As you might imaging, I’m struggling to find and learn the current methods to do many things that were really simple previously. Right now I expecially miss the simplicity of ifcfg-* scripts and associated commands.