Configuring the Interface Address

You assign an address to an interface by specifying the address when configuring the protocol family. For the inet family, configure the interface’s IP address. For the iso family, configure one or more addresses for the loopback interface. For the ccc, tcc, mpls, tnp, and vpls families, you never configure an address.

To assign an address to an interface, include the address statement:

You can include these statements at the following hierarchy levels:

In the address statement, specify the network address of the interface.

For each address, you can optionally configure one or more of the following:

By default, the primary address on an interface is the lowest numbered non-127 preferred address on the interface. To override the default and explicitly configure the preferred address, include the primary statement when configuring the address.

Configuring an Interface IPv4 Address

You can configure router interfaces with a 32-bit IPv4 address and optionally with a destination prefix, sometimes called a subnet mask. An IPv4 address utilizes a 4-octet dotted decimal address syntax (for example, 192.16.1.1). An IPv4 address with destination prefix utilizes a 4-octet dotted decimal address syntax appended with a destination prefix (for example, 192.16.1.1/30).

To configure an IPv4 address on JUNOS routers, use the edit interface interface-name unit number family <inet> address a.b.c.d/nn statement at the [edit interfaces] hierarchy level.

Note: Juniper Networks routers support /31 destination prefixes when used in point-to-point Ethernet configurations; however, it is not supported by many other devices, such as hosts, hubs, or routers. You must determine if the peer system also supports /31 destination prefixes before configuration.

Configuring the Interface IPv6 Address

You represent IPv6 addresses in hexadecimal notation using a colon-separated list of 16-bit values.

You assign a 128-bit IPv6 address to an interface by including the address statement:

address aaaa:bbbb:...:zzzz/nn;

You can include this statement at the following hierarchy levels:

The double colon (::) represents all bits set to 0, as shown in the following example:

interfaces fe-0/0/1 {unit 0 {family inet6 {address fec0:1:1:1::2/64;}}}

Note: You must manually configure the router advertisement and advertise the default prefix for autoconfiguration to work on a specific interface.