Skip to main content
milje22

9 months ago

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 ?

Image of anthony
anthony
9 months ago
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 



Image of americanada
americanada
9 months ago


Image of americanada
americanada
9 months ago

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 ~]#

Image of milje22
milje22
9 months ago
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. 

Image of americanada
americanada
9 months ago
Do you have NetworkManager running, and is the device in question controlled by NM?
Image of milje22
milje22
9 months ago
it was. also I was able to configure eevrything else