Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While answering this question I found something I didn't know and couldn't find an answer for.

In the context of the above question if a computer / server has 2 LAN ports built in on the motherboard (Or 2 seperate Network Cards) should these 2 cards have the same IP address e.g 10.0.0.1 or should they both have different addresses e.g
Port 1 10.0.0.1
Port 2 10.0.0.2 Hypothesising that the user wants just to connect 2 other computers to the servers 2 LAN ports using crossover cable.

I would think they had to have different 2 seperate IP addresses but was wondering what that would mean if using DNS. Would the server have 2 seperate records in DNS. Could it be contacted by either? Which would take precedence?

Any answers on this topic or further information would be greatly appreciated.

share|improve this question
    
Can the downvoter provide a reason? Drive by downvoting is really unhelpful. –  Joe Taylor Feb 15 '12 at 11:10
add comment

4 Answers

up vote 4 down vote accepted

Yes and no.

While e40 is correct in thinking that IP addresses should be unique within a routing domain (i.e. there should ever only be one 10.0.0.1 present on your network - see RFC 5889) you can have multiple hardware devices underlying that single IP address. This is generally done with Link Aggregation Control Protocol (LACP). LACP can function at any of the three lowest OSI layers which of course includes IP. The method in which the IP address is "resolved" (at Layer-3) to which specific MAC address (at Layer-2) for frame delivery is largely implementation dependent (although generally it's round robin).

You could configure IP address aliases on each device so that each NIC could be reachable individually or through the "virtual" IP address that represents the bonded NIC (both devices).

share|improve this answer
add comment

The NICs must each have a separate IP-address, these should normally be in separate subnets.

The exception would be when you are using something such as channel bonding or some hot-failover redundancy system.

share|improve this answer
add comment

Each "LAN port", or NIC, must have a unique IP address. It would be unusual for each of the IPs to be on the same network. The same DNS server could serve both IPs, and usually does. I have an internal and internal NIC, and my same DNS server knows about both of them.

share|improve this answer
add comment

A Domain Name Service deals with Names. You can put in multiple name records (A records) with the same name and different IP address. When the DNS gets a Name request, it returns all A records. If the records are on different subnets, the client can decide to use the appropriate address. If both addresses are on the same subnet, the client may get confused.

You can (but shouldn't) give both LAN ports the same IP address, and put them on physically disconnected networks. Since the networks are physically disconnected, other computers on those networks will not be confused. You could even have only one Name, and one IP address, and computers on physically disconnected networks can't get confused.

But the computer with two LAN ports, or rather the software on the computer with two ports, will get confused. The commonly used API, "Berkeley Sockets" doesn't understand computers with multiple interfaces, and uses the IP address as an alias for the interfaces. Any software written using a portable socket interface won't be able to distinguish the two LAN ports. At the bottom level, the OS won't be confused, but even if ALL of its parts can handle the situation, it will probably notice the error.

Note that if you bond the two interfaces togethor, the OS and the socket API will only see one interface. You won't "give both ports the same IP address" since there will only be one "port" visible to give an IP address to.

share|improve this answer
add comment

Your Answer

 
discard

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.