Netmask

From Hackepedia
Jump to navigationJump to search

A Netmask masks the bits of your network for a particular IP. A netmask is a continuous stream of binary 1's from 0 through 32 bits. Here is a few common netmasks

IP: 192.168.0.1
NM: 255.255.255.0

So the network the netmask indicates is 192.168.0.0/24. Netmasks are often written in CIDR notation, in IPv4 and almost exclusively in IPv6. A /64 which is common in delegation in IPv6 holds an immense amount of data, yet it would be wrong to write it as FFFF:FFFF:FFFF:FFFF::, at least it seems wrong.

In UBO's the netmask is displayed by the ifconfig command:

In BSD:

margaret$ ifconfig vic0
vic0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       lladdr 00:0c:29:9e:6b:a6
       groups: egress
       media: Ethernet autoselect
       status: active
       inet6 fe80::20c:29ff:fe9e:6ba6%vic0 prefixlen 64 scopeid 0x1
       inet 192.168.0.27 netmask 0xffffff00 broadcast 192.168.0.255
       inet6 2001:a60:f074::2 prefixlen 48

In Linux:

[pjp@uranus ~]$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:01:03:DE:BE:6E  
         inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
         inet6 addr: 2001:a60:f074::1/48 Scope:Global
         inet6 addr: fe80::201:3ff:fede:be6e/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1