Can Someone Plz explain this syntax to me?

For the WAN

/ ip address add address=192.168.1.5/24 network=192.168.1.0 broadcast=192.168.1.255 interface=ether1


What does this each part mean and what does it pertain to? Here are my guesses please correct me if I’m wrong.

the first part ip address add address=192.168.1.5/24 changes the ip address of the router to 192.168.1.5? Not sure what the /24 is for.

The next part network 192.168.1.0 broadcast=192.168.1.255 is basically changing settings so that it matches the settings of say the modem or to match whatever other device it is connected to so its on the same subnet, am I right?

Then for the LAN

/ ip address add address=10.10.0.1/24 network=10.10.0.0 broadcast=10.10.0.255 interface=ether2

I’m really in the dark here I’m not sure why its 10.10.0.1/24 instead of 192.168.0.1, still not sure what the /24 is for, that can’t be the port can it? to specify a port its usually a colon :24.

and I still don’t get why its network=10.10.0.0 broadcast=10.10.0.255 although I see the pattern of how they are both like that. Its not like its setting the range of the dhcp list is it?

I would be grateful to know why these commands are implemented like certain scenarios, and just what they mean. Just to note that I’m not looking to do anything complex, I’m just looking for the basics of how things work. I just want to set up a simple hotspot behind a modem.

Thanks

Gordon

/24 is netmask
10.10.0.0 is the address of whole network
10.10.0.255 is the broadcast address, meaning that packet sent to this address will be sent to all devices in this network.

These are basic thing, please look for some book about TCP/IP basics and read it carefully.

/ip address add address=192.168.1.5/24 network=192.168.1.0 broadcast=192.168.1.255 interface=ether1


address=192.168.1.5/24

Here you’re basically adding a neighboring network. /24 is a CIDR what is basically means is that the subnet mask is 255.255.255.0

decimal= 255.255.255.0
bits=    8  .8  .8  .0

It’s basically “how many bits are turned on” in binary.. which turns out to make up your subnet mask.

network=192.168.1.0
broadcast=192.168.1.255

Basically means that (192.168.1.5/24) the network begins at 192.168.1.0 and ends at 192.168.1.255

192.168.1.255 being the broadcast address means that any messages sent to 192.168.1.255 will be broadcast to the whole (192.168.1.1-192.168.1.254) network.

0-255 = how many addresses the network encompasses.. that means that there are 253 usable addresses (255-broadcast and gateway)

Here is a basic tutorial on how subnet masking works; http://compnetworking.about.com/od/workingwithipaddresses/a/subnetmask.htm

You can possibly find more tutorials that expand your knowledge on how networks interact there.