Needing to reboot after adding/removing same gateway route
0
votes
1
answer
2414
views
As a matter of study I'm using VirtualBox with Debian 8 to learn basics of networking with the interface in bridge mode.
I deactivated
dhcp
of my network interface eth0
on /etc/network/interfaces
:
# ...
# iface eth0 inet manual
Now I'm configuring the interface by my own:
# ifconfig eth0 192.168.0.99/24
And then, I test my gateway (which is 192.168.0.1) with ping
and it works perfectly.
Then I add the default gateway to my routes table:
# route add default gateway 192.168.0.1 netmask 255.255.255.0 dev eth0
After some tests, downloads, etc. I see that everything is OK.
Then decided to learn how to delete routes and tested it with my default gateway. It works.
### Here is my problem
After trying to add my gateway again with the same line above I got the "**SIOCADDRT: Network is unreachable**" error.
### What I tried to solve?
1. ifdown
and ifup
my interface;
2. Reconfigure the interface with ifconfig
;
3. Restarting the networking
daemon.
The only thing that works is **restarting** the machine.
**Is there a way to add my route again without the need of restarting the machine?**
Asked by llanfair
(113 rep)
Jan 28, 2017, 11:03 PM
Last activity: Aug 2, 2025, 06:07 PM
Last activity: Aug 2, 2025, 06:07 PM