-2

I´ve a question regarding the distribution of subnets within my linux system or more specifically ubuntu. If I set a ip-adresse with a netmask, how will ubuntu set the netaddress and broadaddress of this specificy subnet.

First example: I´m adding one ip address via:

ip addr add 198.168.0.10/24 dev eth0

Will ubuntu set the netaddress to 198.168.0.0 and broadaddress to 198.168.0.255?

Second example: I´m adding multiple subnets to eth0:

ip addr add 198.168.0.20/27 dev eth0 ip addr add 198.168.0.50/27 dev eth0 ip addr add 198.168.0.70/27 dev eth0 ip addr add 198.168.0.100/27 dev eth0

Will ubuntu set the addresses according to the first example like 198.168.0.0 for the first netaddress, 198.168.0.32 for the second netaddress and so on?

One last question: Would I specify subnets like I just did in the second example?

Noob
  • 1

1 Answers1

1

Net and broadcast addressуы are derivative from address/mask pair. So - yes. As about the last question - who knows what do you need these for. Speaking in general - no, nobody would specify these alises on same l2 interface. I can imagine when someone needs to segment his network, but in this case 202.1Q vlans are used, thus you have different interfaces.

And no, this question isn't Ubuntu- or Linux-spefcific. The IP stack behavior in different implementations in various operating systems at this level is the same (thank god !).

drookie
  • 8,625
  • 1
  • 19
  • 29