Configure the Interface Address
You assign an address to an interface by specifying the address when configuring the protocol family. For the
inetfamily, you configure the interface's IP address. For theisofamily, you configure one or more addresses for the loopback interface. For theccc,tcc,mpls, andtnpfamilies, you never configure an address.To assign an address to an interface, include the
addressstatement at the[edit interfacesinterface-nameunitlogical-unit-numberfamilyfamily]hierarchy level:[edit interfacesinterface-nameunitlogical-unit-numberfamilyfamily]addressaddress{destinationaddress;eui-64;broadcastaddress;preferred;primary;}In the
addressstatement, specify the network address of the interface.For each address, you can optionally configure one or more of the following:
- Address of the remote side of the connection (for point-to-point interfaces only)—Specify this in the
destinationstatement.- Whether the router automatically generates the host number portion of interface addresses—The
eui-64statement applies only to interfaces that carry IPv6 traffic, where 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.- Broadcast address for the interface's subnet—Specify this in the
broadcaststatement; this applies only to Ethernet interfaces, such as the management interfacefxp0, the Fast Ethernet interface, and the Gigabit Ethernet interface.- 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. For more information about preferred addresses, see Configure Default, Primary, and Preferred Addresses and Interfaces.
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
preferredstatement 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 originate packets out the interface where the destination gives no hint about the subnet (for example, some
pingcommands). For more information about primary addresses, see Configure Default, Primary, and Preferred Addresses and Interfaces.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
primarystatement when configuring the address.Configure the IPv6 Address on an Interface
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
addressstatement at the[edit interfacesinterface-nameunitlogical-unit-numberfamily inet6]hierarchy level:[edit interfacesinterface-nameunitlogical-unit-numberfamilyinet6]addressaaaa:bbbb:...:zzzz/nn;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;}}}