0

I am reading Python Networking book:

When a network device generates network traffic that needs to be sent across a network, it first compares the destination's IP address with its own network prefix.

My nmcli:

GENERAL.DEVICE:                         enp3s0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         70:4D:7B:41:40:67
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/0
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.0.12/24
IP4.GATEWAY:                            192.168.0.1
IP4.ROUTE[1]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             8.8.8.8
IP6.ADDRESS[1]:                         fe80::94ea:6996:dd8b:8eec/64
IP6.GATEWAY:  

Where is network prefix?

  • I think this is it 192.168.0.12/24 – George Udosen Oct 12 '18 at 18:47
3

Your address is:

IP4.ADDRESS[1]:                         192.168.0.12/24

/24 means that first 24 bits are network address and the remaining 8 bits (which can be used to create a range between 0-255) are for host addressing.

So in x.x.x.y the network prefix is x.x.x (192.168.0.0) and the y (12) is host address.

Host addressing would start with 1 up to 254 and 255 would be the broadcasting address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.