Does IPv6 have similar concept of network mask?

How does it represent a network?

In the output of ifconfig, does prefixlen 128 represent a network mask?

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1552397  bytes 88437726 (88.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1552397  bytes 88437726 (88.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



IPv6 uses network masks exactly the same way as IPv4. The only real difference is that they're much longer (128 bits). IPv6 uses the slash notation exclusively (no dotted decimal), so masks range from /0 to /128.

Becasue of the much larger address space, it's rare to see a mask length longer than /64.

  • Thanks. IPv6 address itself is 128 bits, If a network mask is 128 bits, does that mean the network only has one host? See my update for an example – Tim Mar 22 at 12:59
  • Yes. It's the equivalent of using a /32 for IPv4. – Ron Trunk Mar 22 at 13:04
  • Do you mean prefixlen 128 represent a network mask? How can the network for prefixlen 128 (only one host) be so different from the network for the IPv4 network mask (have many hosts) for the same network interface? Do they represent the same network? – Tim Mar 22 at 13:05
  • 4
    They are different addressing schemes, so there is no correspondence between them. Also, the IPv4 loopback address,, is always written with a /8 mask (per the RFC), even though technically, there's only one host. – Ron Trunk Mar 22 at 13:26
  • 1
    @chrylis, we have adopted /127 for all our point-to-point links, except for the connection to the telcos, where they require /126 because of the way IPv4 used /30. We have tried, and tried to explain things to them, but they will not listen, so we are careful to test in the lab that any devices we use to connect to them really are immune to the ping pong attack. – Ron Maupin Mar 23 at 11:50

Your example contains a netmask. It is however not specified as a bitmask since this would be very long and confusing but as the length of one-bits in the mask. This is called the prefix length and is given either separately (as in your example) or with slash notation:

inet6 ::1  prefixlen 128

This is equivalent to ::1/128 would look like

ip.  0000:0000:0000:0000:0000:0000:0000:0001
mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

While the mask is pretty much the same as in v4 there are some conventions around assignment. For having a good notation the prefixlen is typically given in multiple of four and /64 is regarded as a single LAN (also required by some autoconf technologies).

If you think of ipv6 it is a good idea to regard the prefix always as dynamic and allow renumbering, then you are good to go.

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.