f22: how to change default gateway via line command

Alchemist raimiiic at gmail.com
Sat Jun 6 18:43:36 UTC 2015


2015-06-06 21:03 GMT+03:00 Dario Lesca <d.lesca at solinos.it>:

> Il giorno sab, 06/06/2015 alle 07.01 -0400, Paul Cartwright ha scritto:
> > On 06/06/2015 05:32 AM, Dario Lesca wrote:
> > > Into Fedora 22 workstation, it's possible to change temporarily via
> > > command line the default gateway, to test another gateway, when I
> > > have
> > > setup the network via DHCP?
> > >
> > > What is the best command line to use?
> > >
> > > Many thanks
> > try :
> > $ man route
> >
> > *DESCRIPTION
> >        Route manipulates the kernel's IP routing tables.
>
> Thanks Paul, but in f22 the command "ip r del default" (or ip r rep)
> not work anymore if the NetworkManager is set to DHCP (see my previous
> message, Thu, 04 Jun 2015
> 14:15:59)
>
> Some other suggest?
>
>
Couple of possible solutions

1) Put ignore-auto-routes=true into connection file in
/etc/NetworkManager/system-connections and restart connection/NM service.
This should reject DHCP routes, and you can add routes manually as tmp
solution.

2) nmcli con mod --temporary {interface} ipv4.never-default true
After that NM will not add default route to that int.

3) In good old days NM honored
/etc/sysconfig/network-scripts/ifcfg-interface config, and "DEFROUTE=no" in
right place meant no def route for that interface. But I am not sure if it
works nowadays, I dont use NM. More no than yes with -NM enabled.

Be careful, don't mess your network by having fun with NetworkManager and
D-Bus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150606/8aaeea81/attachment.html>


More information about the users mailing list