Answer the question
In order to leave comments, you need to log in
Does it make sense to manually specify broadcast for interfaces?
I decided to stop using net-tools and iproute2 at the same time and moved my scripts from ifconfig eth0 192.168.2.1 netmask 255.255.255.0
to
ip link set eth0 up
ip addr add 192.168.2.1/24 dev eth0
1: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 1c:6f:65:c5:d6:d7 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
became:1: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 1c:6f:65:c5:d6:d7 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.1/24 scope global eth0
ip addr
, but the question arose: is it even necessary? And if so, to whom and for what? Moreover, it seems to have prescribed routing like this:# ip route show table local dev eth0 scope link
broadcast 192.168.2.0 proto kernel src 192.168.2.1
broadcast 192.168.2.255 proto kernel src 192.168.2.1
Answer the question
In order to leave comments, you need to log in
There is not much difference, the main thing is that broadcast routes are present in the local table. But here you need to look at the situation: I saw examples of dhcp server autoconfiguration scripts that dropped it (dhcp server) without a broadcast address on the interface.
You can also use a structure like this:
ip addr add 192.168.2.1/24 brd + dev eth0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question