如何通过瞻博网络 SRX 上的 IPSec VPN 隧道转发多播数据包?

网络工程 杜松 多播 杜松-srx
2021-07-10 17:22:37

我在两台 SRX300 设备之间设置了 IPSec 站点到站点 VPN。我正在尝试让多播传播。我正在寻找最简单的配置来获得此设置。我找到了很多文章,但大多数都是比我所拥有的更复杂的用例。我没有 NAT(至少现在还没有)。我希望只启用 IGMP 并且一切正常,但这似乎并不那么容易。

multicast-source---LAN---SRX@remote1          SRX@hub1---LAN---multicast-receiver
192.168.1.100/24      192.168.1.1/24        192.168.2.1/24    192.168.2.100/24
                           10.50.1.1/8--WAN--10.50.1.2/8

(忽略我现在在 WAN 上使用专用 10 网络的事实)

集线器上的 SRX 配置

security {
    ike {
        policy ike-phase1-policy {
            mode aggressive;
            proposal-set compatible;
            pre-shared-key ascii-text "$9$VVs4J5TF39t";
        }
        gateway gw-remote1 {
            ike-policy ike-phase1-policy;
            address 10.50.1.1;
            external-interface ge-0/0/5.0;
        }
    }
    ipsec {
        policy ipsec-phase2-policy {
            proposal-set compatible;
        }
        vpn ike-vpn-remote1 {
            bind-interface st0.0;
            ike {
                gateway gw-remote1;
                ipsec-policy ipsec-phase2-policy;
            }
            establish-tunnels immediately;
        }
    }
...
    zones {
        security-zone trust {
            address-book {
                address hub1 192.168.2.0/24;
            }
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0 {
                    host-inbound-traffic {
                        system-services {
                            all;
                        }
                        protocols {
                            all;
                        }
                    }
                }
            }
        }
        security-zone untrust {
            address-book {
                address remote1 192.168.1.0/24;
            }
            host-inbound-traffic {
                system-services {
                    ike;
                }
                protocols {
                    pim;
                }
            }
            interfaces {
                ge-0/0/5.0 {
                    host-inbound-traffic {
                        system-services {
                            ping;
                        }
                    }
                }
                st0.0 {
                    host-inbound-traffic {
                        protocols {
                            pim;
                        }
                    }
                }
            }
        }
    }
}
interfaces {
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 192.168.2.1/24;
            }
        }
    }
    ge-0/0/5 {
        unit 0 {
            family inet {
                address 10.50.1.2/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 10.255.0.156/32;
            }
        }
    }
    st0 {
        unit 0 {
            family inet;
        }
    }
}
routing-options {
    traceoptions {
        file all-packets-trace;
        flag all;
    }
    static {
        route 192.168.1.0/24 next-hop st0.0;
        route 0.0.0.0/0 next-hop 10.50.1.1;
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface st0.0;
            interface ge-0/0/5.0 {
                passive;
            }
            interface lo0.0;
        }
    }
    pim {
        rp {
            local {
                address 10.255.0.156;
            }
        }
        interface st0.0;
        interface ge-0/0/5.0;
        interface lo0.0 {
            family inet;
        }
    }
}
```

SRX Configuration on remote1 (basically a mirror of above):
```
security {
    ike {
        policy ike-phase1-policy {
            mode aggressive;
            proposal-set compatible;
            pre-shared-key ascii-text "$9$m5F6Ehyrv8";
        }
        gateway gw-hub1 {
            ike-policy ike-phase1-policy;
            address 10.50.1.2;
            external-interface ge-0/0/5.0;
        }
    }
    ipsec {
        policy ipsec-phase2-policy {
            proposal-set compatible;
        }
        vpn vpn-hub1 {
            bind-interface st0.0;
            ike {
                gateway gw-hub1;
                ipsec-policy ipsec-phase2-policy;
            }
            establish-tunnels immediately;
        }
    }
...
    zones {
        security-zone trust {
            address-book {
                address remote1 192.168.1.0/24;
            }
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0 {
                    host-inbound-traffic {
                        system-services {
                            all;
                        }
                        protocols {
                            all;
                        }
                    }
                }
            }
        }
        security-zone untrust {
            address-book {
                address hub1 192.168.2.0/24;
            }
            host-inbound-traffic {
                system-services {
                    ike;
                }
                protocols {
                    pim;
                }
            }
            interfaces {
                ge-0/0/5.0 {
                    host-inbound-traffic {
                        system-services {
                            all;
                        }
                        protocols {
                            all;
                        }
                    }
                }
                st0.0 {
                    host-inbound-traffic {
                        protocols {
                            pim;
                        }
                    }
                }
            }
        }
    }
}
interfaces {
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
    ge-0/0/5 {
        unit 0 {
            family inet {
                address 10.50.1.1/24;
            }
        }
    }
    st0 {
        unit 0 {
            family inet;
        }
    }
}
routing-options {
    traceoptions {
        file all-packets-trace;
        flag all;
    }
    static {
        route 192.168.2.0/24 next-hop st0.0;
        route 0.0.0.0/0 next-hop 10.50.1.2;
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface st0.0;
            interface ge-0/0/1.0 {
                passive;
            }
            interface lo0.0;
        }
    }
    pim {
        rp {
            static {
                address 10.255.0.156;
            }
        }
        interface ge-0/0/5.0;
        interface lo0.0;
        interface st0.0;
    }
}
3个回答

据我所知,您不能通过 IPSec 运行多播。您需要做的是在 IPSec 上使用 GRE,然后通过 GRE 进行多播。

所以本质上你是在 GRE 隧道中封装多播流量,然后由 IPSec 封装。

我相信我的问题在于指定 PIM RP(集合点)。在带有 RP 本身的 SRX 上,必须使用: set pim rp local address ... 但在远程使用: set pim rp static address ...

这似乎解决了一切。

多播路由与单播路由有很大不同。多播与广播一样,通常仅限于单个 LAN,而这正是 IGMP 起作用的地方。您正在尝试多播到不同的网络,这需要启用和配置多播路由,例如 PIM。此外,您的 VPN 隧道必须允许广播(多播),而不是全部允许。

Cisco 有一个关于不同组播协议的图表:

在此处输入图片说明

IGMP 是主机和组播路由器之间的协议。PIM 在路由器之间工作以路由组播数据包。