Skip to content
Ask AI

IPv4 Service Configuration Guide

IPv4 (Internet Protocol Version 4), defined in RFC 791, is the core of the TCP/IP stack. It works at the network layer of the TCP/IP stack, which corresponds to the network layer in the seven-layer OSI network model. It provides connectionless, unreliable, unordered, best-effort delivery of services, and any service requiring reliability must be provided by an upper-layer protocol (e.g. TCP).

The IP address is important, which used to uniquely identify an entity that accesses the Internet. An IPv4 address is 32-bit binary numbers, typically written in dotted decimal notation for easier human use. It is represented by four dotted decimal integers, each corresponding to a byte. For example, an IPv4 address represented in binary as 11000000 10101000 00000000 00000001 translates to 192.168.0.1 in dotted decimal notation. For management purposes, IPv4 addresses are categorized into five classes, namely Class A, Class B, Class C, Class D, and Class E addresses.

Table 1 Classification of IPv4 address

Class of AddressRangeDescription
A0.0.0.0-127.255.255.255The first bit of the first octet of the Class A address is always set to 0.The address 0.0.0.0 is a special address representing all network interfaces on the local machine.The addresses between 127.0.0.0 and 127.255.255.255 are reserved for local loopback testing.The addresses between 10.0.0.0 and 10.255.255.255 are reserved for private networks and must not be routed over the internet.
B128.0.0.0-191.255.255.255The first two bits of the first octet of the Class B address is always set to 10.The addresses between 169.254.0.0 and 169.254.255.255 are reserved for link-local address.The addresses between 172.16.0.0 and 172.31.255.255 are reserved for private networks and must not be routed over the internet.
C192.0.0.0-223.255.255.255The first three bits of the first octet of the Class C address is always set to 110.The addresses between 192.168.0.0 and 192.168.255.255 are reserved for private networks and must not be routed over the internet.
D224.0.0.0-239.255.255.255The first four bits of the first octet of the Class D address is always set to 1110.No subnet mask configuration, reserved for multicast
E240.0.0.0-255.255.255.255The first four bits of the first octet of the Class E address is always set to 1111.No subnet mask configuration, reserved address.

Table 2 Special Address

Net-idHost-idIf allowed as source addressIf allowed as destination addressDescription
All bits are 0All bits are 0YESNOThe address 0.0.0.0 is a special address representing all network interfaces on the local machine.
All bits are 0Host-idYESNOThe special address represents a specific host on the network.
All bits are 1All bits are 1NOYESThe special address represents a restricted broadcast.
Net-id is 127Any value but not all bits are 0 or 1.YESYESThe special address represents loopback address for local testing
Net-idAll bits are 1NOYESThe special address represents a broadcast to the network.

Configure the IPv4 address of the interface

Section titled “Configure the IPv4 address of the interface”

Table 3 Configure IPv4 address of the interface

PurposeCommandsDescription
Enter global configuration view.configure terminal-
Create interface configuration view.interface {ethernet interface-name[.subinterface-number] |link-aggregation lag-id[.subinterface-number]|vlan vlan-id|loopback loopback-id|mgmt 0}-
Configure an IPv4 address of the interface.ip address A.B.C.D/MUnless the interface is loopback, IPv4 address with subnet mask /32 is not allowed to be configured. In other subnet masks, addresses with the host portion all-zeros or all-ones are not allowed.The IPv4 address of Class D or E is not allowed.
Configure secondary IPv4 address of the interface.ip address A.B.C.D/M secondaryAn IPv4 address for the same net-id as the configured IP in this interface, but for a host-id different can be configured in this interface except loopback and mgmt.

Table 4 IPv4 display and maintenance

PurposeCommandsDescription
Display interfaces with IPv4 addresses.show ip interfaces-