Ubuntu – have 2 IP addresses for the same computer

networking

I have a question. So I have a 32-bit Ubuntu Server 12.04 LTS set up on one of my computers. I set up a static IP address for this computer, but now when I go see what devices are using my internet, I notice that my linux server has 2 different IP addresses and both have the same MAC address. I can still ssh into it no problem, but it kind of annoys me seeing two different IP addresses for the same server. Any way to get rid of the other IP address that is not the static IP address that I set up? I don't know if this is important but I have a Netgear WNDR 3700 v3. Any help would be greatly appreciated. Thanks 🙂

Config

# This file describes the network interfaces available on your system  
# and how to activate them. For more information, see interfaces(5).    
# The loopback network interface  
auto lo 
iface lo inet loopback 
iface eth0 inet static
   address 192.168.1.91
   netmask 255.255.255.0
   broadcast  192.168.1.255
   gateway 192.168.1.1 

# The primary network interface  
auto eth0 
iface eth0 inet dhcp

my /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1 

Best Answer

Judging by the interfaces file in your comments, it looks like you may not have commented out the auto eth0 and iface eth0 inet dhcp lines. If this is case (can't tell for sure from the formatting) your machine is setting a static IP for that interface first and then getting a second address from your router and assigning it to the same interface. This is a legitimate and workable setup that shouldn't cause a ton of problems. However, fixing it is only a matter of commenting out those last two lines.

Related Question