A
A
Arthur2015-06-09 14:15:09
ubuntu
Arthur, 2015-06-09 14:15:09

How to reset network interfaces in Ubuntu?

Hello.
I register routes, and without reboot they are not installed.
Is there any way to reset all network interfaces at once?
Tried: /etc/init.d/networking restart , service networking restart , but it doesn't help. Have to restart the server. :(
I prescribe the routes in this way:
nano /etc/network/interfaces
Under the interface I add up route add xxxx netmask xxxx gw xxxx

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergei E., 2015-06-10
@deleted-fromStark

Lower-raise all network interfaces:
in /etc/network/interfaces instead of

up route add xxxx netmask xxxx gw xxxx
insert:
auto eth0
iface eth0 inet static
        address 192.168.0.2/24
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        post-up route add x.x.x.x netmask x.x.x.x gw 192.168.0.1
        post-down route del x.x.x.x netmask x.x.x.x gw 192.168.0.1

but better:
auto eth0
iface eth0 inet static
        address 192.168.0.2/24
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        post-up ip route add x.x.x.x/xx via 192.168.0.1
        post-down ip route del x.x.x.x/xx via 192.168.0.1

K
Konstantin, 2015-06-09
@fallen8rwtf

ifdown eth0 && ifup eth0

A
aardvarkx1, 2015-06-09
@aardvarkx1

Try this:
service networking stop
service networking start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question