Jump to content

Ubuntu gets multiple IPS on reboot

Hello,

 

So I think my server gets multiple IP's on reboot. It's a bit of a critical issue as the server is accessible from local network only until I do my fix.

 

So I posted it here https://askubuntu.com/questions/1011864/server-acts-weird-after-reboot-and-local-ip-changes (Read this for more in depth explanation from my side or ask me.)

never got any help so I'm trying here now.

 

I solve my issue with this (has to be done on EVERY reboot)

dhclient -r -v enp5s0 && rm /var/lib/dhcp/dhclient.* ; dhclient -v enp5s0

I don't really know how it works, someone suggested it and it worked, not permanent tho.

 

So after a reboot the server acts normal until I try access teamspeak, game servers and the website. I don't see whats wrong as if I ssh into the server everything looks as it should.

I can only find 1 thing thats not as it should, and thats this:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=1 Destination Host Unreachable
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
From 192.168.1.2 icmp_seq=5 Destination Host Unreachable
From 192.168.1.2 icmp_seq=6 Destination Host Unreachable

192.168.1.2 is the old IP of the server, it's now running one at the 10.0.* range.

 

How do I solve this? It's really annoying and nobody I have talked to have had any clues.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, Joveice said:

Hello,

 

So I think my server gets multiple IP's on reboot. It's a bit of a critical issue as the server is accessible from local network only until I do my fix.

 

So I posted it here https://askubuntu.com/questions/1011864/server-acts-weird-after-reboot-and-local-ip-changes (Read this for more in depth explanation from my side or ask me.)

never got any help so I'm trying here now.

 

I solve my issue with this (has to be done on EVERY reboot)


dhclient -r -v enp5s0 && rm /var/lib/dhcp/dhclient.* ; dhclient -v enp5s0

I don't really know how it works, someone suggested it and it worked, not permanent tho.

 

So after a reboot the server acts normal until I try access teamspeak, game servers and the website. I don't see whats wrong as if I ssh into the server everything looks as it should.

I can only find 1 thing thats not as it should, and thats this:


PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=1 Destination Host Unreachable
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
From 192.168.1.2 icmp_seq=5 Destination Host Unreachable
From 192.168.1.2 icmp_seq=6 Destination Host Unreachable

192.168.1.2 is the old IP of the server, it's now running one at the 10.0.* range.

 

How do I solve this? It's really annoying and nobody I have talked to have had any clues.

Sounds like it's picking up the IP from the router. Have you checked that?

NOTE: I no longer frequent this site. If you really need help, PM/DM me and my e.mail will alert me. 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Radium_Angel said:

Sounds like it's picking up the IP from the router. Have you checked that?

It's a new router, it never had that IP from it.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Are you sure, that the server does not have static IP configured? Because it is not possible to get multiple IPs through DHCP.

HAL9000: AMD Ryzen 9 3900x | Noctua NH-D15 chromax.black | 32 GB Corsair Vengeance LPX DDR4 3200 MHz | Asus X570 Prime Pro | ASUS TUF 3080 Ti | 1 TB Samsung 970 Evo Plus + 1 TB Crucial MX500 + 6 TB WD RED | Corsair HX1000 | be quiet Pure Base 500DX | LG 34UM95 34" 3440x1440

Hydrogen server: Intel i3-10100 | Cryorig M9i | 64 GB Crucial Ballistix 3200MHz DDR4 | Gigabyte B560M-DS3H | 33 TB of storage | Fractal Design Define R5 | unRAID 6.9.2

Carbon server: Fujitsu PRIMERGY RX100 S7p | Xeon E3-1230 v2 | 16 GB DDR3 ECC | 60 GB Corsair SSD & 250 GB Samsung 850 Pro | Intel i340-T4 | ESXi 6.5.1

Big Mac cluster: 2x Raspberry Pi 2 Model B | 1x Raspberry Pi 3 Model B | 2x Raspberry Pi 3 Model B+

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, jj9987 said:

Are you sure, that the server does not have static IP configured? Because it is not possible to get multiple IPs through DHCP.

Static IP:

auto enp5s0
iface enp5s0 inet static
  address 10.0.0.2
  netmask 255.255.0.0
  gateway 10.0.0.1
  dns-nameservers 8.8.8.8 8.8.4.4

 

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, mikat said:

so you're telling me that it's configured statically and it still has a different ip?

how many interfaces do you have?

1 interface. No, I'm not sure, all I know is that after a reboot "ifconfig" shows everything is correct, if I ping etc 8.8.8.8 it first tries to ping the old IP it had, which I havn't added anywhere else than the interfaces file (that is now changed to the new one)

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Any ideas?

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Joveice,

 

All I can think of is that you have

  1. conflicting static IP settings somewhere on the server in question or
  2. multiple DHCP servers running on your LAN

Maybe it is some configuration file you have set on the server and since forgotten?

 

Network configuration can be a bit hairy, especially on some distributions like Arch which has multiple ways to configure networking (I presume you are running Ubuntu on the server).

 

Also, I think you should tell exactly your network layout (where is the router(s) and switches, and if several, how are they connected, VLAN setup (if any), which device gets the public IP address etc.). That might give some tips on what is wrong. Currently it is just guesswork, since no one can access your server(s) and take a look, and there is too little information on your posts.

 

What's the output of ifconfig on the server, for example?

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, Wild Penquin said:

Joveice,

 

All I can think of is that you have

  1. conflicting static IP settings somewhere on the server in question or
  2. multiple DHCP servers running on your LAN

Maybe it is some configuration file you have set on the server and since forgotten?

 

Network configuration can be a bit hairy, especially on some distributions like Arch which has multiple ways to configure networking (I presume you are running Ubuntu on the server).

 

Also, I think you should tell exactly your network layout (where is the router(s) and switches, and if several, how are they connected, VLAN setup (if any), which device gets the public IP address etc.). That might give some tips on what is wrong. Currently it is just guesswork, since no one can access your server(s) and take a look, and there is too little information on your posts.

 

What's the output of ifconfig on the server, for example?

It's just a simple network, modem, router and the server. I have just found a file (tip to grep for the old IP and see where it's located) where the IP was still in (/etc/dhcpcd.conf) so I chagned that to the new one. Still have not restarted and tested, I also never edited this file in the first place.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Now you are starting to give information that is relevant and would help to get on with this to begin with! Some more questions:

 

Have you looked at https://help.ubuntu.com/lts/serverguide/network-configuration.html.fi#ip-addressing (the whole page)?

 

What files are in /etc/network/interfaces, and what are their contents?

 

What are the contents of the said dhcpd.conf ?

 

EDIT: Also, again, output of 'ifconfig' might be quite relevant! Strip out public IP addresses if you are paranoid, that information is not needed actually.

 

Do you remember what you used to configure your (servers) network in the first place? Did you do it trough a GUI (in Gnome), or something?

 

Please note that both your modem and router might have their own DHCP servers. On what subnets are they? Is your modem connected to the WAN or LAN port (i.e. are they on separate subnets)? What are their respective subnet configs? If they are on the same subnet, you might definitely have more than one DHCP server causing some of your problems.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×