2

I have Oracle Solaris 11.3 installed on my system. I have changed the network configuration profile to DefaultFixed. After that, I have assigned IPs to NIC interfaces by giving below commands:

# ipadm create-addr -T dhcp net0/v4
# ipadm create-addr -T static -a 172.21.67.40 net1/v4

Till this point everything is fine:

root@DellPowerEdge:~# ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net0              ip         ok           --         --
   net0/v4        dhcp       ok           --         172.21.67.37/24
net1              ip         ok           --         --
   net1/v4        static     ok           --         172.21.67.40/16

I tried the below commands:

# ipadm create-addr -T dhcp net0/addr
# ipadm create-addr -T dhcp net1/addr

Now, it is showing me two different IPs for a single interface as below:

root@DellPowerEdge:~# ipadm
NAME              CLASS/TYPE STATE        UNDER      ADDR
lo0               loopback   ok           --         --
   lo0/v4         static     ok           --         127.0.0.1/8
   lo0/v6         static     ok           --         ::1/128
net0              ip         ok           --         --
   net0/addr      dhcp       ok           --         172.21.67.97/24
   net0/v4        dhcp       ok           --         172.21.67.37/24
net1              ip         ok           --         --
   net1/addr      dhcp       ok           --         172.21.67.47/24
   net1/v4        static     ok           --         172.21.67.40/16

All these IPs are accessible.

How are different IPs assigned to single NIC interface? Is it an expected behavior? What is the difference between net0/v4 and net0/addr

  • 1
    "v4" and "addr" are arbitrary strings used to label that interface. It's not uncommon or a problem if a NIC has multiple addresses. – Jesse_b Aug 4 '17 at 15:36
4

net0 is an interface, and net0/addr & net0/v4 are addrobj objects. You may have multiple addrobj associated with the same layer 2 (datalink) network interface.

From Oracle Solaris Administration: Network Interfaces and Network Virtualization:

addrobj

Specifies an identifier for the unique IP address or set of addresses that is used in the system. The addresses can be either IPv4 or IPv6 types.

The identifier uses the format: interface / user_specified_string.

The interface refers to the IP interface to which the address is assigned. The interface variable must reflect the name of the datalink on which the IP interface is configured.

user-specified-string refers to a string of alphanumeric characters that begins with an alphabet letter and has a maximum length of 32 characters. Subsequently, you can refer to the addrobj instead of the numeric IP address when you use any ipadm subcommand that manages addresses in the system, such as ipadm show-addr, or ipadm delete-addr.

  • So my question is, are we using the same IP interface with different addrobj or these addrobj are behaving as a separate unit? Is it kind of threading or something? – Amit24x7 Aug 8 '17 at 7:34
  • 1
    The network interface operates on the data link level (layer 2 in the OSI model), whereas the IP interfaces operate on the network level (layer 3). Someone more knowledgeable than I am would need to explain the internals, however it is completely normal to have multiple IPs behind a single L2 interface, otherwise we wouldn't need L3. – thinkmassive Aug 8 '17 at 14:21
0

This is intended as a comment, but it was marked as too long, so putting it in the answer slot.

Although I wouldn't recommend using the same subnet on the same nic as it's not going to buy you anything. Even using VNICs on the same link won't buy you much more unless you want to control or monitor an IP/link.

Not sure it'll help, but you may also want to consider setting up strict multihoming to help with routing: For systems that are gateways to other domains, such as a firewall or a VPN node, use this procedure to turn on strict multihoming. The hostmodel property controls the send and receive behavior for IP packets on a multihomed system via ipadm.

Verify the current value and note the possible values: ipadm show-prop -p hostmodel ip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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