2

I am trying to manually alter my /etc/network/interfaces file in Ubuntu. I am using these as a baseline:

To configure a dynamic IP address

auto eth0
iface eth0 inet dhcp

Or configure a static IP

auto eth0
iface eth0 inet static
address 192.168.1.14
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

Then once all settings have been entered and saved run this

sudo /etc/init.d/networking restart

I want to alter my wireless card, which according to ifconfig is NOT eth0 but wlp16s0 so the 1st thing I would do is change that. My only question is what value would I input in broadcast

I know that the address is the IP I want to hardcode, gateway is my router IP, netmask is my DNS, network is my router IP

What for Broadcast

2 Answers 2

1

The Broadcast address would be the highest non-assignable address for your subnet. It determines the end point of your network, where the network is the start point.

For example, with the following set up:

IP Address: 192.168.0.2
Gateway: 192.168.0.1
Subnet Mask: 255.255.255.0
Network : 192.168.0.0

We have the We are using a network of 192.168.0.0 (Which is unassignable to one specific client) with the subnet mask of 255.255.255.0 (allowing addresses from 192.168.0.1 up to 192.168.0.254). This means our broadcast address will be

192.168.0.255

As this is one address higher than the highest assignable within the range.


Please note as well that your definitions aren't correct with this statement:

I know that the address is the IP I want to hardcode, gateway is my router IP, netmask is my DNS, network is my router IP

The address is indeed the manually configured IP address for the client and the gateway, in most cases, would be your routers IP address. However, the netmask is not related to DNS in any way, but defines the range of IP addresses available within your subnet. You can read more about this here. Also note that the network address is defining the start point of the network, not your routers IP address. This should be the opposite of the broadcast address, the IP address before the first assignable address.


In all honesty, I don't think it would harm to leave these unset (although I haven't tested this as I don't have a UNIX system to test with). They're usually just for reference and can be automatically worked out from the host IP address and subnet mask.

0

The broadcast address of an IPv4 network is the last address in the network.

This answer in Network Engineering SE discusses IPv4 addressing, and you can use it to figure out the various pieces, including the broadcast address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .