Centos 6.9 with 1 Router with 3 interface & multiple ip from 2 dif. ip pool on same interface.

Issues related to configuring your network
Post Reply
naciberk
Posts: 4
Joined: 2017/06/23 12:06:48

Centos 6.9 with 1 Router with 3 interface & multiple ip from 2 dif. ip pool on same interface.

Post by naciberk » 2017/06/23 12:30:30

Hello. sorry for my bad English.
I have just installed CentOs 6.9 minimal and its running well but i have a problem with the configuration of multiple ip addresses.

We have a router which has 3 LAN interface 192.168.1.1, 192.168.2.1 and 192.168.3.1.
And I have only one netcard on the server. Eth0

My configuration files are like that.

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=MacroMTA

/etc/sysconfig/networks-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.1.20
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=194.239.134.83
DNS2=193.162.153.164


/etc/sysconfig/networks-scripts/ifcfg-eth0:0
DEVICE=eth0:0
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.2.70
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
DNS1=194.239.134.83
DNS2=193.162.153.164


As u can see ip’s from different subnet.

And everytime I restart the service I getting this error but no one else using the ips on the network.
[root@MacroMTA ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 192.168.1.20 is already in use for device eth0...
Determining if ip address 192.168.2.70 is already in use for device eth0... [ OK ]


So what I have tried until now.
1. I have change eth0:0 ip with an another ip from same subnet as in eth0 and restart the service and everything worked fine.
can ping both ip.
2. Back to different subnet again. I have tried to remove GATEWAY from the eth0:0 and restart the servie
same both with gateway or without gateway in eth0:0 cant ping 192.168.2.70
3. I have put gateway as 192.168.1.1 on eth0:0 still same cant ping 192.168.2.70
4. And most strange thing is I CANT ping both ip from an another server under the second ip pool (server has a ip like 192.168.2.41)

Can someone help me please about it.
Last edited by naciberk on 2017/06/25 13:48:52, edited 1 time in total.

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by stevemowbray » 2017/06/23 14:31:44

And everytime I restart the service I getting this error but no one else using the ips on the network.
[root@MacroMTA ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 192.168.1.20 is already in use for device eth0...
Determining if ip address 192.168.2.70 is already in use for device eth0... [ OK ]
I am not seeing an error here. The "Determining if ip address..." messages are informational only.

However, what I am seeing is that you have NM_CONTROLLED=yes for both interfaces, which means you should be managing them with NetworkManager.

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

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by TrevorH » 2017/06/23 16:00:13

You have GATEWAY= in both files and one will override the other as there can only be one default route (without lots of effort).
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

naciberk
Posts: 4
Joined: 2017/06/23 12:06:48

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by naciberk » 2017/06/23 16:58:36

Thanx for your answer Steve.
As I said i have installed the minimal version.
And I normally using turnkey linux it is the first time i using centos.

Is networkmanager allready installed. And how can it help me about my problem.

Again thanx for your time and answer.

naciberk
Posts: 4
Joined: 2017/06/23 12:06:48

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by naciberk » 2017/06/23 17:01:11

Hi Trevor and thanx to you too.
As i wrote in my explan... I have removed gateway from the eth0:0. and than restart the service ... Nothing.. Didnt help. Still cannot ping 192.168.2.70

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by Whoever » 2017/06/24 01:48:21

What exactly are you trying to achieve with your eth0:0 interface? Why do you think that you need this?

Why not just shut down eth0:0 and let the router do its job?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by jlehtone » 2017/06/24 09:31:28

naciberk wrote:We have a router which has 3 LAN interface 192.168.1.1, 192.168.2.1 and 192.168.3.1.
And I have only one netcard on the server. Eth0
3 LAN interfaces. 3 "netcards" on the router. Each connected to a different logical subnet.

To which subnet (interface on the router) is the server connected to? Why should it care about any other subnet, for they are all beyond the router.

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

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by TrevorH » 2017/06/24 09:48:11

And if you're really building a router using CentOS, I'd suggest that you look at the Ubiquiti EdgeMax series of routers. You can pick up a 5 gigabit port PoE enabled router for not very much money at all and it would be much better suited to doing the job of a router.
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

naciberk
Posts: 4
Joined: 2017/06/23 12:06:48

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by naciberk » 2017/06/24 23:47:38

Guys thanx for your replays.. I using zywall 1050 firewalls
And all the windows server server behind the 3 different interface. Which has different ip pool can see and ping each other but only the server which has ip l ike 192.168.1.xx can ping the centos ip som as 192.168.1.20
Others can not. And as i said. I have removed gateway input from the eth0:0 file. Still no server can"t reach the eth0:0ip (192.168.2.70).

Any idea???

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Centos 6.9 with 1 Router with 3 interface & and multiple ip from 2 subnet on same interface.

Post by Whoever » 2017/06/25 01:48:45

You have a router. Use that to get packets to traverse different subnets.

Remove eth0:0.

Post Reply