Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Configuring the Interface Address

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

Note: The point-to-point (PPP) address is taken from the loopback interface address that has the primary attribute. When the loopback interface is configured as an unnumbered interface, it takes the primary address from the donor interface.

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

You can include these statements at the following hierarchy levels:

  • [edit interfaces interface-name unit logical-unit-number family family]
  • [edit logical-systems logical-system-name interfaces interface-name unit logical-unit-number family family]

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

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

  • Broadcast address for the interface subnet—Specify this in the broadcast statement; this applies only to Ethernet interfaces, such as the management interface fxp0, em0, or me0 the Fast Ethernet interface, and the Gigabit Ethernet interface.
  • Address of the remote side of the connection (for point-to-point interfaces only)—Specify this in the destination statement.
  • PPP properties to the remote end—Specify this in the destination-profile statement. You define the profile at the [edit access group-profile name ppp] hierarchy level (for point-to-point interfaces only).
  • Whether the router or switch automatically generates the host number portion of interface addresses—The eui-64 statement applies only to interfaces that carry IPv6 traffic, in which the prefix length of the address is 64 bits or less, and the low-order 64 bits of the address are zero. This option does not apply to the loopback interface (lo0) because IPv6 addresses configured on the loopback interface must have a 128-bit prefix length.
  • Whether this address is the preferred address—Each subnet on an interface has a preferred local address. If you configure more than one address on the same subnet, the preferred local address is chosen by default as the source address when you originate packets to destinations on the subnet.

    By default, the preferred address is the lowest-numbered address on the subnet. To override the default and explicitly configure the preferred address, include the preferred statement when configuring the address.

  • Whether this address is the primary address—Each interface has a primary local address. If an interface has more than one address, the primary local address is used by default as the source address when you send packets from an interface where the destination provides no information about the subnet (for example, some ping commands).

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

Configuring Interface IPv4 Addresses

You can configure router or switch interfaces with a 32-bit IP version 4 (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 with a destination prefix appended (for example, 192.16.1.1/30).

To configure an IPv4 address on routers and switches running Junos OS, 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 and switches support /31 destination prefixes when used in point-to-point Ethernet configurations; however, they are not supported by many other devices, such as hosts, hubs, routers, or switches. You must determine if the peer system also supports /31 destination prefixes before configuration.

Configuring Interface IPv6 Addresses

Note: IPv6 is not currently supported for the QFX Series.

You represent IP version 6 (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;

Note: You cannot configure a subnet zero IPv6 address because RFC 2461 reserves the subnet-zero address for anycast addresses, and Junos OS complies with the RFC.

You can include this statement at the following hierarchy levels:

  • [edit interfaces interface-name unit logical-unit-number family inet6]
  • [edit logical-systems logical-system-name interfaces interface-name unit logical-unit-number family inet6]

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 or switch advertisement and advertise the default prefix for autoconfiguration to work on a specific interface.

Published: 2013-01-23