Re: f22: how to change default gateway via line command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/09/2015 03:40 PM, Dario Lesca wrote:
Il giorno mar, 09/06/2015 alle 15.44 +0800, Ed Greshko ha scritto:
Or not....

[root@f22k ~]# nmcli conn mod enp0s3 ipv4.gateway 192.168.1.18
Error: Failed to modify connection 'enp0s3': ipv4.gateway: gateway
cannot be set if there are no addresses configured

FWIW, on this system ....

[root@f22k ~]# ip route sho
default via 192.168.1.1 dev enp0s3  proto static  metric 100
192.168.1.0/24 dev enp0s3  proto kernel  scope link  src
192.168.1.224  metric 100

[root@f22k ~]# nmcli conn show enp0s3 | grep 192.168.1.1
IP4.GATEWAY:                            192.168.1.1
IP4.DNS[1]:                             192.168.1.1
DHCP4.OPTION[5]:                        domain_name_servers =
192.168.1.1
DHCP4.OPTION[8]:                        dhcp_server_identifier =
192.168.1.1
DHCP4.OPTION[17]:                       routers = 192.168.1.1
DHCP4.OPTION[29]:                       next_server = 192.168.1.1

I'm not the OP, but I figured I'd test it out anyway.

I have the same error:

[lesca@dodo ~]$ nmcli conn show p6p1 | grep -E '(192.168.61.|ipv4.add)'
ipv4.addresses:
IP4.INDIRIZZO[1]:                       192.168.61.80/24
IP4.GATEWAY:                            192.168.61.254
IP4.DNS[1]:                             192.168.61.254
DHCP4.OPZIONE[4]:                       server_name = 192.168.61.254
DHCP4.OPZIONE[5]:                       domain_name_servers = 192.168.61.254
DHCP4.OPZIONE[7]:                       ip_address = 192.168.61.80
DHCP4.OPZIONE[10]:                      dhcp_server_identifier = 192.168.61.254
DHCP4.OPZIONE[13]:                      broadcast_address = 192.168.61.255
DHCP4.OPZIONE[18]:                      routers = 192.168.61.254
DHCP4.OPZIONE[28]:                      network_number = 192.168.61.0
DHCP4.OPZIONE[30]:                      next_server = 192.168.61.254

[lesca@dodo ~]$ LANG=c sudo nmcli conn mod p6p1 ipv4.gateway 192.168.61.250
Error: Failed to modify connection 'p6p1': ipv4.gateway: gateway cannot be set if there are no addresses configured

This occur why the field "ipv4.addresses" is empty, like many other
"ipv4.*" flags:

[lesca@dodo ~]$ nmcli conn show p6p1 | grep ipv4.
ipv4.method:                            auto
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:
ipv4.gateway:                           --
ipv4.routes:
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes

I think you have to change the method to "manual", then set the IP
address and route:

sudo nmcli conn mod p6p1 ipv4.method manual ipv4.address 192.168.61.80/24 ipv4.gateway 192.168.61.254

The "auto" method for an ethernet port means DHCP.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-    I'm telling you that the kernel is stable not because it's a    -
-    kernel, but because I refuse to listen to arguments like this.  -
-                                              -- Linus Torvalds     -
----------------------------------------------------------------------
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux