f22: how to change default gateway via line command

James Hogarth james.hogarth at gmail.com
Tue Jun 9 07:26:56 UTC 2015


On 8 Jun 2015 13:12, "Dario Lesca" <d.lesca at solinos.it> wrote:
>
> Il giorno sab, 06/06/2015 alle 21.43 +0300, Alchemist ha scritto:
> > Couple of possible solutions
>
> Thanks Alchemist, one of that sure probably partially solves my
> problem.
>
> But the question is: Why in f22 (or new version of NetworkManager?) it
> has removed the option to change the default gateway via "ip r rep..."
> command line, like i do in previous version or all other version of
> redhat or centos?
>
> I thing this is a issue, not a feature.
>
> Thanks
>

Think of it this way.

You have your network manager configured (via static or dhcp) to have your
default route pointed somewhere.

NM tries to maintain its configuration so when it notices you've changed
the route at the kernel level it doesn't know it's an admin override and
fixes what it thinks is a broken setup.

On NM based systems instead of using ip route try the nmcli command.

Something like this ought to work:

nmcli conn mod <connection-profile-name> ipv4.gateway
<ip-address-of-gateway>

You can see the present configuration NM thinks it should be with:

nmcli conn show <connection-profile-name>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150609/61e10071/attachment.html>


More information about the users mailing list