Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring IPv6 BGP Routes over IPv4 Transport

    This example demonstrates how to export both IPv6 and IPv4 prefixes over an IPv4 connection where both sides are configured with an IPv4 interface.

    Requirements

    No special configuration beyond device initialization is required before you configure this example.

    Overview

    Keep the following in mind when exporting IPv6 BGP prefixes:

    • BGP derives next-hop prefixes using the IPv4-compatible IPv6 prefix. For example, the IPv4 next-hop prefix 10.19.1.1 translates to the IPv6 next-hop prefix ::ffff:10.19.1.1.

      Note: There must be an active route to the IPv4-compatible IPv6 next hop to export IPv6 BGP prefixes.

    • An IPv6 connection must be configured over the link. The connection must be either an IPv6 tunnel or a dual-stack configuration. Dual stacking is used in this example.
    • When configuring IPv4-compatible IPv6 prefixes, use a mask that is longer than 96 bits.
    • Configure a static route if you want to use normal IPv6 prefixes. This example uses static routes.

    Figure 1 shows the sample topology.

    Figure 1: Topology for Configuring IPv6 BGP Routes over IPv4 Transport

    Topology for Configuring IPv6
BGP Routes over IPv4 Transport

    Configuration

    CLI Quick Configuration

    To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

    Device R1

    set interfaces fe-1/2/0 unit 1 family inet address 192.168.10.1/24set interfaces fe-1/2/0 unit 1 family inet6 address ::ffff:192.168.10.1/120set interfaces lo0 unit 1 family inet address 10.10.10.1/32set protocols bgp group ext type externalset protocols bgp group ext family inet unicastset protocols bgp group ext family inet6 unicastset protocols bgp group ext export send-directset protocols bgp group ext export send-staticset protocols bgp group ext peer-as 200set protocols bgp group ext neighbor 192.168.10.10set policy-options policy-statement send-direct term 1 from protocol directset policy-options policy-statement send-direct term 1 then acceptset policy-options policy-statement send-static term 1 from protocol staticset policy-options policy-statement send-static term 1 then acceptset routing-options rib inet6.0 static route ::ffff:192.168.20.0/120 next-hop ::ffff:192.168.10.10set routing-options static route 192.168.20.0/24 next-hop 192.168.10.10set routing-options autonomous-system 100

    Device R2

    set interfaces fe-1/2/0 unit 2 family inet address 192.168.10.10/24set interfaces fe-1/2/0 unit 2 family inet6 address ::ffff:192.168.10.10/120set interfaces fe-1/2/1 unit 3 family inet address 192.168.20.21/24set interfaces fe-1/2/1 unit 3 family inet6 address ::ffff:192.168.20.21/120set interfaces lo0 unit 2 family inet address 10.10.0.1/32set protocols bgp group ext type externalset protocols bgp group ext family inet unicastset protocols bgp group ext family inet6 unicastset protocols bgp group ext export send-directset protocols bgp group ext export send-staticset protocols bgp group ext neighbor 192.168.10.1 peer-as 100set protocols bgp group ext neighbor 192.168.20.1 peer-as 300set policy-options policy-statement send-direct term 1 from protocol directset policy-options policy-statement send-direct term 1 then acceptset policy-options policy-statement send-static term 1 from protocol staticset policy-options policy-statement send-static term 1 then acceptset routing-options autonomous-system 200

    Device R3

    set interfaces fe-1/2/0 unit 4 family inet address 192.168.20.1/24set interfaces fe-1/2/0 unit 4 family inet6 address ::ffff:192.168.20.1/120set interfaces lo0 unit 3 family inet address 10.10.20.1/32set protocols bgp group ext type externalset protocols bgp group ext family inet unicastset protocols bgp group ext family inet6 unicastset protocols bgp group ext export send-directset protocols bgp group ext export send-staticset protocols bgp group ext peer-as 200set protocols bgp group ext neighbor 192.168.20.21set policy-options policy-statement send-direct term 1 from protocol directset policy-options policy-statement send-direct term 1 then acceptset policy-options policy-statement send-static term 1 from protocol staticset policy-options policy-statement send-static term 1 then acceptset routing-options rib inet6.0 static route ::ffff:192.168.10.0/120 next-hop ::ffff:192.168.20.21set routing-options static route 192.168.10.0/24 next-hop 192.168.20.21set routing-options autonomous-system 300

    Configuring Device R1

    Step-by-Step Procedure

    The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide PDF Document.

    To configure Device R1:

    1. Configure the interfaces, including both an IPv4 address and an IPv6 address.
      [edit interfaces]user@R1# set fe-1/2/0 unit 1 family inet address 192.168.10.1/24user@R1# set fe-1/2/0 unit 1 family inet6 address ::ffff:192.168.10.1/120user@R1# set lo0 unit 1 family inet address 10.10.10.1/32
    2. Configure EBGP.
      [edit protocols bgp group ext]user@R1# set type externaluser@R1# set export send-directuser@R1# set export send-staticuser@R1# set peer-as 200user@R1# set neighbor 192.168.10.10
    3. Enable BGP to carry IPv4 unicast and IPv6 unicast routes. .
      [edit protocols bgp group ext]user@R1# set family inet unicastuser@R1# set family inet6 unicast

      IPv4 unicast routes are enabled by default. The configuration is shown here for completeness.

    4. Configure the routing policy.
      [edit policy-options]user@R1# set policy-statement send-direct term 1 from protocol directuser@R1# set policy-statement send-direct term 1 then acceptuser@R1# set policy-statement send-static term 1 from protocol staticuser@R1# set policy-statement send-static term 1 then accept
    5. Configure some static routes.
      [edit routing-options]user@R1# set rib inet6.0 static route ::ffff:192.168.20.0/120 next-hop ::ffff:192.168.10.10user@R1# set static route 192.168.20.0/24 next-hop 192.168.10.10
    6. Configure the autonomous system (AS) number.
      [edit routing-options]user@R1# set autonomous-system 100

    Results

    From configuration mode, confirm your configuration by entering the show interfaces, show policy-options, show protocols, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

    user@R1# show interfacesfe-1/2/0 {unit 1 {family inet {address 192.168.10.1/24;}family inet6 {address ::ffff:192.168.10.1/120;}}}lo0 {unit 1 {family inet {address 10.10.10.1/32;}}}
    user@R1# show policy-optionspolicy-statement send-direct {term 1 {from protocol direct;then accept;}}policy-statement send-static {term 1 {from protocol static;then accept;}}
    user@R1# show protocolsbgp {group ext {type external;family inet {unicast;}family inet6 {unicast;}export [ send-direct send-static ];peer-as 200;neighbor 192.168.10.10;}}
    user@R1# show routing-optionsrib inet6.0 {static {route ::ffff:192.168.20.0/120 next-hop ::ffff:192.168.10.10;}}static {route 192.168.20.0/24 next-hop 192.168.10.10;}autonomous-system 100;

    If you are done configuring the device, enter commit from configuration mode. Repeat the configuration on Device R2 and Device R3, changing the interface names and IP addresses, as needed.

    Verification

    Confirm that the configuration is working properly.

    Checking the Neighbor Status

    Purpose

    Make sure that BGP is enabled to carry IPv6 unicast routes.

    Action

    From operational mode, enter the show bgp neighbor command.

    user@R2> show bgp neighbor
    Peer: 192.168.10.1+179 AS 100  Local: 192.168.10.10+54226 AS 200  
      Type: External    State: Established    Flags: <Sync>
      Last State: OpenConfirm   Last Event: RecvKeepAlive
      Last Error: None
      Export: [ send-direct send-static ] 
      Options: <Preference AddressFamily PeerAS Refresh>
      Address families configured: inet-unicast inet6-unicast
      Holdtime: 90 Preference: 170
      Number of flaps: 0
      Peer ID: 10.10.10.1      Local ID: 10.10.0.1         Active Holdtime: 90
      Keepalive Interval: 30         Peer index: 0   
      BFD: disabled, down
      Local Interface: fe-1/2/0.2                       
      NLRI for restart configured on peer: inet-unicast inet6-unicast
      NLRI advertised by peer: inet-unicast inet6-unicast
      NLRI for this session: inet-unicast inet6-unicast
      Peer supports Refresh capability (2)
      Stale routes from peer are kept for: 300
      Peer does not support Restarter functionality
      NLRI that restart is negotiated for: inet-unicast inet6-unicast
      NLRI of received end-of-rib markers: inet-unicast inet6-unicast
      NLRI of all end-of-rib markers sent: inet-unicast inet6-unicast
      Peer supports 4 byte AS extension (peer-as 100)
      Peer does not support Addpath
      Table inet.0 Bit: 10000
        RIB State: BGP restart is complete
        Send state: in sync
        Active prefixes:              1
        Received prefixes:            3
        Accepted prefixes:            2
        Suppressed due to damping:    0
        Advertised prefixes:          4
      Table inet6.0 Bit: 20000
        RIB State: BGP restart is complete
        Send state: in sync
        Active prefixes:              0
        Received prefixes:            1
        Accepted prefixes:            1
        Suppressed due to damping:    0
        Advertised prefixes:          2
      Last traffic (seconds): Received 24   Sent 12   Checked 60  
      Input messages:  Total 132    Updates 6       Refreshes 0     Octets 2700
      Output messages: Total 133    Updates 3       Refreshes 0     Octets 2772
      Output Queue[0]: 0
      Output Queue[1]: 0
    
    Peer: 192.168.20.1+179 AS 300  Local: 192.168.20.21+54706 AS 200  
      Type: External    State: Established    Flags: <Sync>
      Last State: OpenConfirm   Last Event: RecvKeepAlive
      Last Error: None
      Export: [ send-direct send-static ] 
      Options: <Preference AddressFamily PeerAS Refresh>
      Address families configured: inet-unicast inet6-unicast
      Holdtime: 90 Preference: 170
      Number of flaps: 0
      Peer ID: 10.10.20.1      Local ID: 10.10.0.1         Active Holdtime: 90
      Keepalive Interval: 30         Peer index: 1   
      BFD: disabled, down
      Local Interface: fe-1/2/1.3                       
      NLRI for restart configured on peer: inet-unicast inet6-unicast
      NLRI advertised by peer: inet-unicast inet6-unicast
      NLRI for this session: inet-unicast inet6-unicast
      Peer supports Refresh capability (2)
      Stale routes from peer are kept for: 300
      Peer does not support Restarter functionality
      NLRI that restart is negotiated for: inet-unicast inet6-unicast
      NLRI of received end-of-rib markers: inet-unicast inet6-unicast
      NLRI of all end-of-rib markers sent: inet-unicast inet6-unicast
      Peer supports 4 byte AS extension (peer-as 300)
      Peer does not support Addpath
      Table inet.0 Bit: 10000
        RIB State: BGP restart is complete
        Send state: in sync
        Active prefixes:              1
        Received prefixes:            3
        Accepted prefixes:            2
        Suppressed due to damping:    0
        Advertised prefixes:          4
      Table inet6.0 Bit: 20000
        RIB State: BGP restart is complete
        Send state: in sync
        Active prefixes:              0
        Received prefixes:            1
        Accepted prefixes:            1
        Suppressed due to damping:    0
        Advertised prefixes:          2
      Last traffic (seconds): Received 1    Sent 15   Checked 75  
      Input messages:  Total 133    Updates 6       Refreshes 0     Octets 2719
      Output messages: Total 131    Updates 3       Refreshes 0     Octets 2734
      Output Queue[0]: 0
      Output Queue[1]: 0

    Meaning

    The various occurrences of inet6-unicast in the output shows that BGP is enabled to carry IPv6 unicast routes.

    Checking the Routing Table

    Purpose

    Make sure that Device R2 has BGP routes in its inet6.0 routing table.

    Action

    From operational mode, enter the show route protocol bgp inet6.0 command.

    user@R2> show route protocol bgp table inet6.0
    inet6.0: 7 destinations, 10 routes (7 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    ::ffff:192.168.10.0/120  [BGP/170] 01:03:49, localpref 100, from 192.168.20.1
                          AS path: 300 I
                        > to ::ffff:192.168.20.21 via fe-1/2/1.3
    ::ffff:192.168.20.0/120  [BGP/170] 01:03:53, localpref 100, from 192.168.10.1
                          AS path: 100 I
                        > to ::ffff:192.168.10.10 via fe-1/2/0.2

    Published: 2012-08-01