Score:0

Can't connect to servers that have a static IP in a dynamic network

kn flag

In my network, you get an automatically assigned IP address. Friday I set up 3 debian servers to instead use the static addresses 192.168.0.177, .188 and .237. Today I powercycled them and I can no longer reach them. As in, connection timed out when trying to ssh.

I made the ip static by changing /etc/network/interfaces on the servers to use a static gateway and ip: (interfaces.d is an empty directory)

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto eno5
iface eno5 inet static
address 192.168.0.172
netmask 255.255.255.0
gateway 192.168.0.1

When physically run ip addr on that server it shows that eno5 is indeed on 192.168.0.172. However, every host is unreachable from the server's POV.

On my workstation, arp -a shows this:

? (192.168.0.172) at <incomplete> on enp5s0
_gateway (192.168.0.1) at fc:ec:da:45:75:4f [ether] on enp5s0
? (192.168.0.188) at <incomplete> on enp5s0
? (192.168.0.237) at <incomplete> on enp5s0

With some entries ommited. What does <incomplete> imply?

What could possibly be going on here? Why is it not just working?

Score:0
mx flag

If the dynamically allocated Adresses do not lie within the same subnet 192.168.0.0/24, you must must ensure that routing between the networks works.

If the 3 static IP adresses lie within the pool of dynamically allocated IPs, it might happen, that the DHCP server already allocated these IPs to other hosts in your network. Usually you have a setup like this:

local network: 192.168.0.0/24

dynamic allocatable IPs: 192.168.0.10 - 192.168.0.150

The range may vary and you can use IP adresses not within the given range to setup static IPs. But every IP within this range might sooner or later be allocated to some host in your network. If this happens and you allocated the IP as a static IP too, you have two hosts with the same IP in your network and will get errors.

You can also distribute a static IP with your DHCP. Every DHCP server offers the option to allocate a static IP to some given host, usually identified by its MAC Address.

AnnoyinC avatar
kn flag
Thanks, those are things to keep in mind. Hoewver, it turned out I had a loose network cable.
Score:0
kn flag

I had a loose network cable in the switch, after clicking it in correctly it all worked fine. It seems means that there is no host on that address (thus no MAC addr) but that the gateway has reserved the address.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.