Example for Configuring PIM over GRE Tunnel


Networking Requirements

Figure 1. PIM over GRE Tunnel Configuration Example

As shown in Figure 1, multicast services are deployed in the network. Switch B does not support multicast protocols, so multicast traffic needs to be transmitted between Switch A and Switch C through a GRE tunnel.

Follow the configuration roadmap below to configure PIM over GRE tunnel.

  1. Run OSPF route protocol on Switch A, Switch B and Switch C for underlay communication.
  2. Create GRE tunnel interfaces on Switch A and Switch C to establish a GRE tunnel; Run BGP route protocol on GRE tunnel interfaces.
  3. Enable PIM function on the GRE tunnel interfaces to enable the transmission of multicast packets by the GRE tunnel.

Procedure

Switch A

Step1        Configure VLAN interface.

admin@SwitchA# set vlans vlan-id 11 l3-interface vlan11
admin@SwitchA# set vlans vlan-id 22 l3-interface vlan22
admin@SwitchA# set interface gigabit-ethernet te-1/1/45 family ethernet-switching native-vlan-id 11
admin@SwitchA# set interface gigabit-ethernet te-1/1/13 family ethernet-switching native-vlan-id 22
admin@SwitchA# set l3-interface loopback lo address 100.100.100.100 prefix-length 32 
admin@SwitchA# set l3-interface vlan-interface vlan11 address 10.1.1.2 prefix-length 24
admin@SwitchA# set l3-interface vlan-interface vlan22 address 10.20.1.1 prefix-length 24

Step2        Enable IP routing.        

admin@SwitchA# set ip routing enable true

Step3        Configure OSPF route protocol for underlay communication.

admin@SwitchA# set protocols ospf router-id 1.1.1.1
admin@SwitchA# set protocols ospf network 10.20.1.0/24 area 0
admin@SwitchA# set protocols ospf network 100.100.100.100/32 area 0

Step4        Configure GRE tunnel name, IP, source IP, destination IP etc.

admin@SwitchA# set l3-interface tunnel tnl0 address 10.40.1.1 prefix-length 24
admin@SwitchA# set l3-interface tunnel tnl0 tunnel-mode gre-ip
admin@SwitchA# set l3-interface tunnel tnl0 source 100.100.100.100 
admin@SwitchA# set l3-interface tunnel tnl0 destination 200.200.200.200

Step5        Configure BGP route protocol for the GRE tunnel.

admin@SwitchA# set protocols bgp local-as 100
admin@SwitchA# set protocols bgp ebgp-requires-policy false
admin@SwitchA# set protocols bgp neighbor 10.40.1.2 remote-as 200
admin@SwitchA# set protocols bgp ipv4-unicast network 10.1.1.0/24

Step6        Enable PIM on the GRE tunnel interface, configure Switch A’s GRE tunnel interface as the static RP.

admin@SwitchA# set protocols pim interface vlan11 sm
admin@SwitchA# set protocols pim interface tnl0 sm
admin@SwitchA# set protocols pim rp 10.40.1.1 group 225.0.0.0/8

Step7        Commit the configuration.

admin@SwitchA# commit

Switch B

Step1        Configure VLAN interface.

admin@SwitchB# set vlans vlan-id 22 l3-interface vlan22
admin@SwitchB# set vlans vlan-id 33 l3-interface vlan33
admin@SwitchB# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 22
admin@SwitchB# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 33
admin@SwitchB# set l3-interface vlan-interface vlan22 address 10.20.1.2 prefix-length 24
admin@SwitchB# set l3-interface vlan-interface vlan33 address 10.30.1.1 prefix-length 24

Step2        Enable IP routing.         

admin@SwitchB# set ip routing enable true

Step3        Configure OSPF for the connections between Switch A, Switch B and Switch C.

admin@SwitchB# set protocols ospf router-id 2.2.2.2
admin@SwitchB# set protocols ospf network 10.30.1.0/24 area 0
admin@SwitchB# set protocols ospf network 10.20.1.0/24 area 0

Step4        Commit the configuration.

admin@SwitchB# commit

Switch C

Step1        Configure VLAN interface.

admin@SwitchC# set vlans vlan-id 33 l3-interface vlan33
admin@SwitchC# set vlans vlan-id 44 l3-interface vlan44
admin@SwitchC# set interface gigabit-ethernet te-1/1/17 family ethernet-switching native-vlan-id 33
admin@SwitchC# set interface gigabit-ethernet te-1/1/23 family ethernet-switching native-vlan-id 44
admin@SwitchC# set l3-interface loopback lo address 200.200.200.200 prefix-length 32
admin@SwitchC# set l3-interface vlan-interface vlan33 address 10.30.1.2 prefix-length 24
admin@SwitchC# set l3-interface vlan-interface vlan44 address 10.2.1.2 prefix-length 24

Step2        Enable IP routing.         

admin@SwitchC# set ip routing enable true

Step3        Configure OSPF routes for underlay communication.

admin@SwitchC# set protocols ospf router-id 3.3.3.3
admin@SwitchC# set protocols ospf network 10.30.1.0/24 area 0
admin@SwitchC# set protocols ospf network 200.200.200.200 area 0

Step4        Configure GRE tunnel name, IP, source IP, destination IP etc.

admin@SwitchC# set l3-interface tunnel tnl0 address 10.40.1.2 prefix-length 24
admin@SwitchC# set l3-interface tunnel tnl0 tunnel-mode gre-ip
admin@SwitchC# set l3-interface tunnel tnl0 source 200.200.200.200 
admin@SwitchC# set l3-interface tunnel tnl0 destination 100.100.100.100

Step5        Configure BGP routes for the GRE tunnel.

admin@SwitchC# set protocols bgp local-as 200
admin@SwitchC# set protocols bgp ebgp-requires-policy false
admin@SwitchC# set protocols bgp neighbor 10.40.1.1 remote-as 100
admin@SwitchC# set protocols bgp ipv4-unicast network 10.2.1.0/24

Step6        Enable PIM on the GRE tunnel interface, configure Switch A’s GRE tunnel interface as the static RP.

admin@SwitchC# set protocols pim interface vlan33 sm
admin@SwitchC# set protocols pim interface tnl0 sm
admin@SwitchC# set protocols pim rp 10.40.1.1 group 225.0.0.0/8

Step7        Configure the IGMP function of the connected receiver interface.

admin@SwitchC# set protocols igmp interface vlan44

Step8        Commit the configuration.

admin@SwitchC# commit

Verifying the Configuration

  • After the configuration is complete, run run show pim interface to view the configuration and operation state of PIM on an interface.
admin@switchA# run show pim interface
Interface  State   Address     PIM Nbrs  PIM DR       FHR  IfChannels
 tnl0       up     10.40.1.1   1         10.40.1.2    0    2
 pimreg     up     0.0.0.0     0         local        0    0
 vlan11     up     10.1.1.2    0         local        0    0 

admin@switchC# run show pim interface
Interface   State  Address      PIM Nbrs  PIM DR  FHR  IfChannels
 tnl0       up     10.40.1.2    1         local   0    0
 pimreg     up     0.0.0.0      0         local   0    0 
 vlan44     up     10.2.1.2     0         local   0    2
  • Run command run show l3-interface tunnel to display information about the GRE tunnel interface.
admin@SwitchA# run show l3-interface tunnel tnl0
tnl0        State:UP
            Tunnel Source: 100.100.100.100   
            Tunnel Destnation: 200.200.200.200
            Tunnel protocol/transport: gre-ip
            Inet addr: 10.40.1.1
            Traffic statistics:
              5 sec input rate IPv4 1200 packets/sec, IPv6 0 packets/sec
              5 sec forwarding rate IPv4 80 packets/sec, IPv6 0 packets/sec
              IPv4 Input Packets............................28
              IPv4 Forwarding Packets.......................5
              IPv6 Input Packets............................0
              IPv6 Forwarding Packets.......................0
  • Run commands run show pim neighbor and run show pim rp-info to that the PIM neighbor information and RP information have been generated correctly.
admin@switchA# run show pim neighbor
Interface  Neighbor     Uptime    Holdtime  DR Pri
tnl0       10.40.1.2    03:10:40  00:01:34  1

admin@switchA# run show pim rp-info
RP address   group/prefix-list  OIF        I am RP  Source  Group-Type
10.40.1.1    225.0.0.0/8       tnl0        yes      Static   ASM
  • In this example, multicast source 10.1.1.5 sends multicast information to multicast group 225.0.0.2. The multicast routing table generated by PIM protocol can be viewed through the run show mroute command, which shows that multicast traffic can be transmitted through the GRE tunnel.
admin@switchA# run show mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - SGRpt Pruned, F - Register flag, T - SPT-bit set
 Source     Group      Flags   Proto  Input      Output     TTL  Uptime
 *          225.0.0.2   S      none   tnl0       none       0    --:--:--
 10.1.1.5   225.0.0.2   SFT    PIM    vlan11     pimreg     1    02:59:50
                               STAR              tnl0       1

admin@switchC# run show mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - SGRpt Pruned, F - Register flag, T - SPT-bit set
 Source     Group      Flags   Proto    Input      Output  TTL  Uptime
 *          225.0.0.2  SC      IGMP     tnl0       pimreg  1    03:07:44
                               IGMP                vlan44  1
 10.1.1.5   225.0.0.2  ST      STAR     tnl0       vlan44  1    03:07:17

 


Copyright © 2024 Pica8 Inc. All Rights Reserved.