Can a computer with 2 network cards have the same IP address for both
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT
Music by Eric Matyas
https://www.soundimage.org
Track title: Melt
--
Chapters
00:00 Can A Computer With 2 Network Cards Have The Same Ip Address For Both
00:59 Answer 1 Score 0
01:18 Answer 2 Score 1
01:35 Accepted Answer Score 12
02:29 Answer 4 Score 0
03:48 Thank you
--
Full question
https://superuser.com/questions/336854/c...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#networking #lan #ip
#avk47
ACCEPTED ANSWER
Score 12
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).
ANSWER 2
Score 1
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.
ANSWER 3
Score 0
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 NIC and external NIC, and my same DNS server knows about both of them.
ANSWER 4
Score 0
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.