0

i've got additional /27 IP's subnet for my Debian server. I was trying multiple configurations, but without success on adding whole subnet.

Running

ip addr add 231.231.231.0/32 dev eth0

Working well, and i can ping the following IP without any problem.

Runngin

ip addr add 231.231.231.0/27 dev eth0

makes only .0 IP pingable, the rest not.

What i'm doing wrong? Thanks!

  • First, those are multicast addresses, which should not be assigned to host interfaces. Multicast addresses are group addresses for all the hosts which subscribe to a multicast group. They are not assigned to host interfaces the way that unicast addresses are. If you are assigning them to host interfaces, then you do not understand how multicast works. – Ron Maupin Jul 24 '17 at 21:01
  • By the way, the multicast addresses that you show are in a reserved range that you are not allowed to use. Also, network masks make no sense when using multicast addresses because each address is a group address. – Ron Maupin Jul 24 '17 at 21:37

1 Answers1

2

AIUI the mask in an "ip addr add" command is the "subnet mask" used to create implicit routes in the routing table, set up broadcast addresses etc. It does not add every IP address in the range to the interface.

Afaict if you want to add all the addresses in the range you have to do them all individually.

(as a side note if you want to use all of the addresses as regular addresses you should add them with /32 masks so that Linux doesn't do special stuff with the first and last addresses of the subnet).

Peter Green
  • 4,211
  • 12
  • 30
  • The subnet masks doesn't really set routes, but indicates which part of the network is 'local', eg directly reachable. With 231.231.231.0/27, you tell linux that 231.231.231.0 to 231.231.231.31 is directly reachable through that interface and everything else needs a routing table lookup (usually it will go to the default gateway) – unilynx Jul 24 '17 at 21:07
  • It sets a route indicating that the subnet is directly reachable (I.E. a route with an interface and no next hop). You can see that route in "IP route list" and even delete it with "ip route del" if you really want (of course it will come back when you take the interface down and back up). – Peter Green Jul 24 '17 at 21:28