Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I seem to be using two IP addresses on my PC. I use DHCP to get an IP address and then I statically set an IP address and activate it. ifconfig says that I am using the address given by DHCP but I am also able to connect to a device on the network of the statically set IP. What is going on here?

DHCP address: Statically set address: OS: Fedora 8

share|improve this question
please post the output of ip link show, ip addr show, and netstat -rn. When you connect to the device, what is its address? – Mike Pennington Jun 20 '11 at 9:12
up vote 5 down vote accepted

What is the question here?

  • Yes, it sounds like you have two addresses assigned.
  • Yes you can talk to the box using either one of them.
  • If you talk from that box to other machines, it will use the most relevant address, meaning if there is an IP address in the same subnet, it will use that one to talk.
  • One of the addresses, probably the one assigned first, is going to be marked as the default route and the gateway address set will be used to talk to everything outside of either of the two subnets.
  • Assigning an address doesn't remove others. If you want only one address you will need to turn off DHCP acquisition first.
share|improve this answer
I was under the impression that a Device could only have one IP address. So what you are saying is a Device can have more than one IP address at the same time? – toc777 Jun 20 '11 at 12:16
@toc777: I don't know what gave you that impression, but it is wrong. Any given network device can have many addresses. I have some routers with dozens of addresses on a single interface. – Caleb Jun 20 '11 at 12:18
For some reason I thought a NIC could only have one IP assigned to it, I guess because the default is one. Normally I'd do some research on a question before asking it but I thought I knew what I was talking about :( – toc777 Jun 20 '11 at 12:29
@toc777 A network interface can have multiple addresses. It's not so common on a desktop or server machine though, it mostly happens on network appliances (routers, firewalls, that kind of stuff). So it might indicate that something is misconfigured. Or maybe you're running a virtual machine with a bridged network interface; if so, one of the addresses goes to the real machine and the other one goes to the VM. – Gilles Jun 20 '11 at 19:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.