Interface configuration files not doing their part.

Issues related to configuring your network
Post Reply
Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Interface configuration files not doing their part.

Post by Kunwar » 2016/07/31 13:23:29

I have a fresh install of CentOS 7 on a machine that has two NICs. I plan to make a server out of this machine but it's been acting weird and the interface is ignoring configurations in the config file (ifcfg-enpXX) rather it follows configs in the GUI network manager. How can this behaviour be controlled? I want the config files to take over cuz the current setup makes the internal interface the default route whereas I have the external interface as default route in the config files. Since it's not following the config files its not being useful.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Interface configuration files not doing their part.

Post by TrevorH » 2016/07/31 14:03:13

Post the content of all of the ifcfg-* files. If you really must obscure anything then obscure tthe first set of digits in ip addresses so that we can see something useful.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Interface configuration files not doing their part.

Post by Kunwar » 2016/08/01 11:51:19

I was able to fix the issue. There was another config file for the same interface that had -Wired-connection-1 at the end. I deleted that file and now it's taking configs from the default file. However there are still some issues. I have set ifcfg-enp2s0 to external interface with defroute=yes and the other one as internal with default route set to no but when ever I ping google.com it does not get resolved and I am not able to ping as the system tries to ping everything through the internal interface. I have my laptop attached to internal interface with correct settings but its still not able to ping the system.

To use internet after boot I have to restart the internal interface so that the requests start going through the external interface. I have tried reinstalling twice but this happens every-time.
Here are the interface configs:

/etc/sysconfig/networkscripts/ifcfg-enp2s0

Code: Select all

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp2s0"
UUID="6ad65846-37d9-4f99-8e4d-44c7287809ee"
ONBOOT="yes"
HWADDR="F4:F2:6D:03:5A:C6"
IPADDR0="10.0.2.249"
NETMASK="255.255.255.0"
GATEWAY0="10.0.2.1"
DNS1="10.0.2.1"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
ZONE=external
/etc/sysconfig/networkscripts/ifcfg-eno1

Code: Select all

HWADDR=C4:34:6B:54:3B:24
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=no
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno1
UUID=5d3c75ce-bb8a-4b39-ad63-c00fcab35327
ONBOOT=yes
IPADDR=10.0.1.1
NETMASK=255.0.0.0
GATEWAY=10.0.1.1
ZONE=internal
IP configurations on the laptop are:

Code: Select all

IP address: 10.0.1.2
Subnet mask = 255.0.0.0
Gateway = 10.0.1.1
DNS = 8.8.8.8
I am stuck here can't fix this behaviour.

forumitu
Posts: 118
Joined: 2014/02/20 14:30:51

Re: Interface configuration files not doing their part.

Post by forumitu » 2016/08/01 12:03:56

Are you sure that your subnet mask is 255.0.0.0? If yes, it means that the other subnet with mask 255.255.255.0 is part of it. I think it is not correct, subnets must not overlap.

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Interface configuration files not doing their part.

Post by Kunwar » 2016/08/01 12:30:02

Yes the subnet mask for internal and laptop is 255.0.0.0 and I have deliberately set external to 255.255.255.0 to limit it so if I ping something in 10.0.0.0/8 subnet it doesn't go through the external interface. Even that's not working I can't ping anything through internal interface and this is very weird. Config files are acting strange.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Interface configuration files not doing their part.

Post by gerald_clark » 2016/08/01 15:23:49

You have two conflicting GATEWAY definitions.
You can only have one default gateway.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Interface configuration files not doing their part.

Post by TrevorH » 2016/08/01 15:55:37

And you really can't have two interfaces with overlapping subnet definitions like that. Well not easily anyway.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Interface configuration files not doing their part.

Post by Kunwar » 2016/08/01 16:26:03

I removed the gateway setting from the internal interface and changes the subnet form 255.255.255.0 to 255.0.0.0 on the external interface. Now internet does not work on the start but it works on the laptop (gets internet from the internal interface ie the LAN side) for 3 4 minutes and then that goes down as well.

TrevorH, do you mean I should move one interface to a difference subnet?

Can iptables be used in this case to control the behavior along with selinux?

forumitu
Posts: 118
Joined: 2014/02/20 14:30:51

Re: Interface configuration files not doing their part.

Post by forumitu » 2016/08/02 05:57:57

Change the NETMASK for both the two interfaces from 255.0.0.0 to 255.255.255.0.

Post Reply