Tuesday, November 20, 2018

Change a network interface to remove it from being the default gateway in Fedora

Sometimes it's required to change a network interface to avoid it from being the default gateway. This can be easily achieved by changing the network interface configuration file.

The only change required is to change the value of DEFROUTE of the configuration file to no

e.g.:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp3s0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=no
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp3s0
UUID=e73d611-501-33ac-9fd-4946bcfdf8
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
DEVICE=enp3s0

No comments:

Post a Comment