connect two servers by one ethernet cable

Issues related to configuring your network
Post Reply
mjz
Posts: 60
Joined: 2020/02/13 22:05:02

connect two servers by one ethernet cable

Post by mjz » 2020/03/19 15:53:27

I want to connect two servers without a router for direct connection.
I set one as 10.0.0.1 and the other as 10.0.0.2

What should the other settings be?

I set subnet mask to 255.255.255.0
and the gateway for both as 10.0.0.1

(DNS = 10.0.0.1 for one and 10.0.0.2 for the other)

the NIC shows network is on and "connected", but ping loses all packets - no transfer. What am I failing to do?

tunk
Posts: 674
Joined: 2017/02/22 15:08:17

Re: connect two servers by one ethernet cable

Post by tunk » 2020/03/19 16:29:19

Try to remove the gateway settings on both servers.
If it still doesn't work, check the firewall.

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

Re: connect two servers by one ethernet cable

Post by jlehtone » 2020/03/19 18:19:13

Two machines, one cable between them, and no other connections?
Then there are no gateways for those two machines. There definitely is no gateway in that subnet.

Gateway means router. Router routes between subnets.
When you have a packet that is not destined to anyone in any of the subnets that you are directly connected, then you forward it to gateway and hope that the gateway knows the destination or next hop.

DNS is a server that resolves names to IP (and back). Do you even need names?
Even if you have names, would static entries in /ets/hosts be enough?

Run nmcli on each server. What does it show?

aks
Posts: 2958
Joined: 2014/09/20 11:22:14

Re: connect two servers by one ethernet cable

Post by aks » 2020/03/19 19:11:08

Uh, a cross over cable (unless the ports are MDIX)?

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: connect two servers by one ethernet cable

Post by TrevorH » 2020/03/19 19:29:01

Unless the network card is > 10 years old (probably more) then they should all do MDIX.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

BShT
Posts: 178
Joined: 2019/10/09 12:31:40

Re: connect two servers by one ethernet cable

Post by BShT » 2020/03/20 17:14:30

crossover or not are you sure this cable works?

Post Reply

Return to “CentOS 8 - Networking Support”