# Shared IP Interfaces

You can create multiple shared IP interfaces over the same layer 2 logical interface—for example, atm 5/3.101—enabling more than one IP interface to share the same logical resources. You can configure one or more shared IP interfaces. Data sent over shared interfaces uses the same layer 2 interface. You can configure shared interfaces as you would unshared IP interfaces. Each shared interface has its own statistics.

Some layer 2 interfaces require a primary IP interface to negotiate certain IP parameters—for example, IPCP for PPP, ARP for Ethernet, and Inverse ARP for Frame Relay. If you do not configure a primary IP interface in such cases, the layer 2 interface cannot become operationally up.

A primary IP interface is the default interface for receiving data that arrives on the layer 2 interface. If you configure shared IP interfaces for the same layer 2 interface as your primary IP interface, by default data received on the layer 2 interface is received on the virtual router corresponding to the primary IP interface. A primary IP interface and all of its shared IP interfaces have the same interface location. You can configure a shared IP interface to receive data on the same layer 2 interface as a primary IP interface. You can delete primary and shared IP interfaces independently of each other.

You can create a primary IP interface as you do any other IP interface, as shown in the following example:

host1(config)#virtual-router vr-a:vrf-2 host1:vr-a:vrf-2:(config)#interface atm 5/3.101 host1:vr-a:vrf-2:(config-if)#ip address 10.1.1.1 255.255.255.255 host1:vr-a:vrf-2:(config-if)#exit

You do not have to configure a primary IP interface if you do not need one as described above. In the absence of a primary interface, you can still configure shared IP interfaces; however, in this scenario, data received on the layer 2 interface is discarded.

You cannot create shared IP interfaces for the following kinds of interface:

- IP floating interfaces (IP interfaces that stack over MPLS stacked tunnels)
- Loopback interfaces
- Null interfaces

For information about configuring shared IP interfaces to receive data on the same layer 2 interface as a primary IP interface, see JunosE Broadband Access Configuration Guide.

## Configuring Shared IP Interfaces

To share IP interfaces:

1. Create a layer 2 interface.
   host1(config)#interface atm 5/3 host1(config-if)#interface atm 5/3.101
2. (Optional) Create a primary IP interface.
   host1(config-if)#ip address 10.1.1.1 255.255.255.255 host1(config-if)#exit
3. Create the shared IP interface.
   host1(config)#interface ip si0
4. Associate the shared IP interface with the layer 2 interface by one of the following methods:
   - Statically
     host1(config-if)#ip share-interface atm 5/3.101
   - Dynamically
     host1:vr-a:vrf-1(config-if)#ip share-nexthop 10.0.0.1
5. To fully configure the shared interface, assign an address (or make the interface unnumbered).
   host1(config-if)#ip address 2.2.2.2 255.0.0.0

interface ip

- Use to create an IP interface for interface sharing.
- Use the specified name to refer to the shared IP interface; you cannot use the layer 2 interface to refer to them, because the shared interface can be moved.
- Example
  host1(config)#interface ip si0
- Use the no version to delete the IP interface.
- See interface ip

ip share-interface

- Use to specify the layer 2 interface used by a shared IP interface. The command fails if the layer 2 interface does not yet exist. The command is not supported (that is, it fails) if you use an RSVP tunnel (for example, tunnel mpls:1) to identify the layer 2 interface.
- If you issue this command on a shared IP interface, you cannot issue the ip share-nexthop command for the interface.
- After creating the shared IP interface, you can configure it as you do any other IP interface.
- The shared interface is operationally up when the layer 2 interface is operationally up.
- You can create operational shared IP interfaces in the absence of a primary IP interface.
- Example
  host1(config-if)#ip share-interface atm 5/3.101
- Use the no version to remove the association between the layer 2 interface and the shared IP interface. You can delete shared and primary IP interfaces independently.
- See ip share-interface

ip share-nexthop

- Use to specify that the shared IP interface dynamically tracks a next hop. If the next hop changes, the shared IP interface moves to the new layer 2 interface associated with the IP interface toward the new next hop.
- If you issue this command on a shared IP interface, you cannot issue the ip share-interface command for the interface.
- If you issue this command on a shared IP interface, the shared interface cannot dynamically track the next hop for the specified destination if the next-hop IP address is resolvable over MPLS.
- If you specify a virtual router, the command fails if the VR does not already exist. If you do not specify a VR, the current VR is assumed.
- After creating the shared IP interface, you can configure it as you do any other IP interface.
- The shared interface is operationally up when the layer 2 interface associated with the specified next hop is operationally up. However, if the layer 2 interfaced associated with the specified next hop is an MPLS next hop (for example, an RSVP or LDP tunnel), the shared interface remains operationally down.
- Use the no version to halt tracking of the next hop.
- See ip share-nexthop

## Moving IP Interfaces

You can move an IP shared interface from one layer 2 interface to another by issuing the ip share-interface command to specify a different layer 2 interface. Moving an IP interface does not affect interface statistics, packets forwarded through the interface, or policies attached to the IP interface.

Example

The following commands create shared interface si0 on the layer 2 interface atm5/3.101:

host1(config)#virtual-router vr-a:vrf-1 host1:vr-a:vrf-1(config)#interface ip si0 host1:vr-a:vrf-1(config-if)#ip share-interface atm 5/3.101 host1:vr-a:vrf-1(config-if)#exit

The following commands move shared interface si0 to the layer 2 interface atm5/3.201:

host1:vr-a:vrf-1(config)#interface ip si0 host1:vr-a:vrf-1(config-if)#ip share-interface atm 5/3.201

## IP Shared Interface Statistics

Each shared interface has its own statistics. Packets transmitted on a shared IP interface are always counted only in the shared IP interface.

## Subscriber Interfaces

A subscriber interface is an extension of a shared IP interface. Shared IP interfaces are unidirectional—they can transmit but not receive traffic. In contrast, subscriber interfaces are bidirectional—they can both receive and transmit traffic.

For details about configuring and using subscriber interfaces, see JunosE Broadband Access Configuration Guide.