A
A
Alexey Vinogradov2019-08-29 18:01:40
Computer networks
Alexey Vinogradov, 2019-08-29 18:01:40

How to setup LAN between servers on Centos 7?

Hello everyone, in general, the situation is as follows, there are 2 servers each with 2 physical network interfaces, eno1 and eno2.
The cable from the provider comes to the first server directly (not through a router)
The eno1 network settings are as follows:

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eno1
UUID=faea4984-9e51-4683-8600-b4329de2860e
DEVICE=eno1
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPADDR=176.106.244.10
PREFIX=24
GATEWAY=176.106.244.1
IPV6INIT=no
DNS1=176.106.240.6
DNS2=176.106.240.5

With this, everything seems to be fine and the server looks externally from this interface.
The eno2 settings are:
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eno2
UUID=87d5b874-8470-4b23-a456-08949654ed97
DEVICE=eno2
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPADDR=192.168.0.100
PREFIX=24
IPV6INIT=no
DNS1=176.106.240.6
DNS2=176.106.240.5

everything seems to be fine here, too, and the first server is assigned a local ip 192.168.0.100 which is pinged on the server itself.
Next, the port of the first eno2 server is connected to the port of the second eno1 server with a patch cord and its settings are as follows:
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eno1
UUID=faea4984-9e51-4683-8600-b4329de28625
DEVICE=eno1
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPADDR=176.106.244.3
PREFIX=24
GATEWAY=176.106.244.1
IPV6INIT=no
DNS1=176.106.240.6
DNS2=176.106.240.5

And here everything is already bad, since the Internet does not appear on the second server (this is the problem number one)
Also, the eno2 interface settings on the second server are as follows:
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eno2
UUID=87d5b874-8470-4b23-a456-08949654ed99
DEVICE=eno2
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
IPADDR=192.168.0.101
PREFIX=24
IPV6INIT=no
DNS1=176.106.240.6
DNS2=176.106.240.5

Everything is half good here, that is, the local IP is assigned to the server and pinged from the server itself, but not pinged from the first one.
There are two questions, how to establish a local connection between two servers, and how to share the Internet from the first server to the second one without unraveling your psyche?
PS In addition to this, on the first machine, added the line net.ipv4.ip_forward = 1 to the /etc/sysctl.conf file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Berkutman, 2019-08-29
@Berkutman

5d67f639c1461841312609.png
Yes, and allow all ICMP traffic, you can comment out the lines in the filter parameters in centos. 5d67f6afaec8b588281234.png
Further, for security, configure yourself as you need . I will
increase what I wrote, too lazy to rewrite. Sori 5d67f734deca0573650399.png
And on server2 as a gateway address server1 I
took the address as an example, insert your
Yes and try to disable the default firewall on two machines with the command:
systemctl stop firewalld , systemctl disable firewalld
Server1 and Server2 , do their networks support auto-mdix?
If not, then you need a cross or at least a switch between them
Read:
There are 3 types of ports: MDI, MDIX, Auto-MDIX.
They differ only in that ports of different types use different contacts to receive and transmit a signal.
As a rule, MDI is a port of a subscriber device (for example, a computer network card). In order to connect an MDI port to an MDIX port, a straight cable is required, if you need to connect two MDI ports (for example 2 computers), then you will need a crossover cable. In MDI ports, pins 1 and 2 are used for signal transmission, pins 3 and 6 for signal reception.
MDIX ports are usually used in hubs and switches. To connect two MDIX ports (for example, to connect two hubs), you need a crossover cable. In MDIX ports, pins 1 and 2 are used for signal reception, pins 3 and 6 for signal transmission.
Auto-MDIX
The Auto-MDIX Ethernet interface is capable of automatically detecting which kind of port is required; when using Auto-MDIX, the type of cable used does not matter. Both straight and crossover cables can be used.

K
kisaa, 2019-08-30
@kisaa

Switch the cable on the second server to a different interface. You have confusion in subnets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question