Score:0

Is the network interface card(NIC) prerequisite of IP addresses?

ph flag

Here is the command to assign IP address to an interface for Linux server.

ip addr add ADDRESS dev IFNAME

Where IFNAME is the interface name and ADDRESS is the IP address you want to assign to the interface.

To add address 192.168.121.45 with netmask 24 to device eth0, you would type:

sudo ip address add 192.168.121.45/24 dev eth0

NIC belongs to the physical layer, IP belongs to the IP layer, they are independent. I would like to ask further questions to figure out the relation between NIC and IP address.

  • Is the NIC prerequisite of IP address?
  • Must IP address be attached to a NIC?
  • Can ip address live alone on IP layer without NIC?

Reference

  1. Linux ip Command: Assign IP addresses to an interface
  2. serverFault: Can a single network card have 2 IP addresses?
yagmoth555 avatar
cn flag
Hi, please edit your question as your question is unclear. Please specify your goal. As a switch can route with a IP, even if it's not bind to a NIC.
Ryan Lyu avatar
ph flag
Hi @yagmoth555, Thanks for your feedback. I have made the question more concrete. I will reopen it if you think the detail is adequate.
Zac67 avatar
ru flag
@RyanLyu Define *NIC* - physical interface? logical/virtual interface?
Ryan Lyu avatar
ph flag
Hi @Zac67, in this place, NIC is general. I am trying to figure out the relation between NIC and IP addresses and assuming NIC is the container of IP addresses. I will appreciate if you could provide your insights.
djdomi avatar
za flag
https://unix.stackexchange.com/questions/152331/how-can-i-create-a-virtual-ethernet-interface-on-a-machine-without-a-physical-ad will answer this quetion :) and to be honestly, a NIC does only provide connectivity, the protocol is a other layer, remind the OSI model
Score:2
ru flag

You don't necessarily need a NIC (physical interface). You need an interface though, either physical, logical or virtual.

There are loopback interfaces, built into the local TCP/IP stack, virtual NICs (vNICs) for virtual machines, switch virtual interfaces (SVIs) for routing on layer-3 switches, TUN/TAP interfaces for VPN, and many other types of virtual interfaces.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.