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.

Operational Behavior of Interfaces when the Same IPv4 Address is Assigned to Them

You can configure the same IPv4 address on multiple physical interfaces. When you assign the same IPv4 address to multiple physical interfaces, the operational behavior of those interfaces differs, depending on whether they are implicitly or explicitly point-to-point .

Note: By default, all interfaces are assumed to be point-to-point (PPP) interfaces. For all interfaces except aggregated Ethernet, Fast Ethernet, and Gigabit Ethernet, you can explicitly configure an interface to be a point-to-point connection.

The following examples show the sample configuration of assigning the same IPv4 address to implicitly and explicilty point-to-point interfaces, and their corresponding show interfaces terse command outputs to see their operational status.

  • Configuring same IPv4 address on implicitly PPP interfaces:

    [edit]user@host# show
    ge-0/1/0 { unit 0 {family inet {address 200.1.1.1/24;}}}
    ge-3/0/1 { unit 0 {family inet {address 200.1.1.1/24;}}}
    The sample output shown below for the above configuration reveals that only ge-0/1/0.0 was assigned the same IPv4 address 200.1.1.1/24 and its link state was up, while ge-3/0/1.0 was not assigned the IPv4 address, though its link state was up, which means that it will be operational only when it gets a unique IPv4 address other than 200.1.1.1/24.

    show interfaces terse

    user@host> show interfaces terse ge*
    Interface               Admin Link Proto    Local                 Remote
            ge-0/1/0                up    up
            ge-0/1/0.0              up    up   inet     200.1.1.1/24
                                       multiservice
            ge-0/1/1                up    down
            ge-3/0/0                up    down
            ge-3/0/1                up    up
            ge-3/0/1.0              up    up   inet
                                       multiservice
  • Configuring same IPv4 address on explicitly PPP interfaces:

    [edit]user@host# show
    so-0/0/0 { unit 0 {family inet {address 200.1.1.1/24;}}}
    so-0/0/3 { unit 0 {family inet {address 200.1.1.1/24;}}}
    The sample output shown below for the above configuration reveals that both so-0/0/0.0 and so-0/0/3.0 were assigned the same IPv4 address 200.1.1.1/24 and that their link states were down, which means that to make them operational atleast one of them will have be configured with a unique IPv4 address other than 200.1.1.1/24.

    show interfaces terse

    user@host> show interfaces terse so*
    Interface               Admin Link Proto    Local                 Remote
    so-0/0/0                up    up
    so-0/0/0.0              up    down inet     200.1.1.1/24
    so-0/0/1                up    up
    so-0/0/2                up    down
    so-0/0/3                up    up
    so-0/0/3.0              up    down inet     200.1.1.1/24
    so-1/1/0                up    down
    so-1/1/1                up    down
    so-1/1/2                up    up
    so-1/1/3                up    up
    so-2/0/0                up    up
    so-2/0/1                up    up
    so-2/0/2                up    up
    so-2/0/3                up    down

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: 2014-04-25