IPv4.gateway

Trying to configure network on my VM With RHEL. ipv4.gateway isn’t an option? Why and how do I get around this ?
  • post-author-pic
    Anthony J
    01-12-2019

    Linux is the most configurable environment on the planet. Heck, it's what runs the routers for the gateways. So there is a way, we just have to make sure we know where it is.


    It depends on your enviornment, if you aren't running DHCP where the gateway is automatically configured (you would configure it on the router) which DHCP on the linux box would automatically grab the correct gateway. Then you would use the  following file to change the default gateway in the GATEWAY= directive in the file blow.

    /etc/sysconfig/network 



  • post-author-pic
    Mike C
    01-13-2019



  • post-author-pic
    Mike C
    01-13-2019

    This sounds more like  nmcli / NM type thing.  Try setting the method to manual then you should be able to configure the gateway:

    [root@server1 ~]# nmcli connection modify eth0 ipv4.method manual

    [root@server1 ~]# nmcli connection modify eth0 ipv4.gateway 192.168.4.1

    [root@server1 ~]#

  • post-author-pic
    Jesse M
    01-14-2019

    Tried it didnt work. Gateway was not in the 

    vi /etc/sysconfig/network file either.   Gw4 and ip4.gateway are not options when using bash-completion.  This is RHEL 7 also. 

  • post-author-pic
    Mike C
    01-14-2019

    Do you have NetworkManager running, and is the device in question controlled by NM?

  • post-author-pic
    Jesse M
    01-14-2019

    it was. also I was able to configure eevrything else 

Looking For Team Training?

Learn More