Problem with two network interfaces

Issues related to configuring your network
Post Reply
beab2001
Posts: 2
Joined: 2018/11/12 13:15:10

Problem with two network interfaces

Post by beab2001 » 2018/11/12 13:38:48

Good morning,

We need your help to identify a failure that is occurring when we configure two networks, the case is as follows:
We have a network card in a network server 192.168.0.0 and 10.20.0.0, each one with its routes and configurations, since my computer located in the 192 network arrived perfect towards the 192, but it does not reach the 10.20 network, We have configured the routes and the interfaces without success, we had this same configuration in another Debian server and we could arrive without problems to the IP of the network 10.20:


[root@POLSCL01ASK02 network-scripts]# vi ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
NAME=ens160
UUID=88eb9eb6-7dff-4c96-8126-5cf4fe01ecb5
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.0.16
PREFIX=24
NOZEROCONF=yes
GATEWAY=192.168.0.71
DNS1=192.168.0.6
DNS2=192.168.0.2
NETMASK=255.255.255.0

[root@POLSCL01ASK02 network-scripts]# vi ifcfg-ens192
DEVICE=ens192
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=10.20.0.5
NETMASK=255.255.255.192
NOZEROCONF=yes
NETWORK=10.20.0.0
HWADDR=00:50:56:8a:51:f2


[root@POLSCL01ASK02 extensions.d]# ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.16 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::250:56ff:fe8a:1355 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:8a:13:55 txqueuelen 1000 (Ethernet)
RX packets 10300342 bytes 2375867014 (2.2 GiB)
RX errors 0 dropped 1654 overruns 0 frame 0
TX packets 9343253 bytes 2059732804 (1.9 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.20.0.5 netmask 255.255.255.192 broadcast 10.20.0.63
inet6 fe80::250:56ff:fe8a:51f2 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:8a:51:f2 txqueuelen 1000 (Ethernet)
RX packets 2877376 bytes 931031131 (887.9 MiB)
RX errors 0 dropped 207 overruns 0 frame 0
TX packets 2353707 bytes 502868101 (479.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


[root@POLSCL01ASK02 extensions.d]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.71 0.0.0.0 UG 100 0 0 ens160
10.20.0.0 10.20.0.1 255.255.255.192 U 101 0 0 ens192
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 ens160


Thank you very much for your help.

User avatar
fdisk
Posts: 42
Joined: 2017/11/04 00:59:56

Re: Problem with two network interfaces

Post by fdisk » 2018/11/12 16:26:01

Hi,

1) make sure ip forwarding is enabled at the router:
https://wiki.centos.org/TipsAndTricks/IPForwarding

2) Check your firewall rules to allow your services

3) make sure Network A knows how to reach network B and vice versa.
Example (temporary!):
On hosts at 192.168.0.0/24 network:

Code: Select all

ip route add 10.20.0.0/24 via 192.168.0.16
On hosts at 192.168.0.0/24 network:

Code: Select all

ip route add 192.1168.0.0/24 via 10.20.0.5
Have a look here how to make routes permanent on centos:
https://www.centos.org/docs/5/html/5.2/ ... outes.html

beab2001
Posts: 2
Joined: 2018/11/12 13:15:10

Re: Problem with two network interfaces

Post by beab2001 » 2018/11/12 20:59:19

Thank you very much for your answer. I'm going to try what you tell me.

Post Reply