背景
我有以下配置,它使用 lt 接口在 2 个路由实例(默认和一个称为 vpn 的自定义实例)之间路由流量。
我这样做的原因是我可以有重叠的 IP 范围/子网,并且只使用目标 NAT 来绕过它。
我的测试设备是 SRX 100 并且具有以下本地 IP
fe-0/0/0.0 - 1.1.1.1/30 - Overlapping IP range
fe-0/0/1.0 - 192.168.218.240/24 - IPSEC to another firewall on 192.168.218.1
fe-0/0/7.0 - 10.10.10.1/24 - Internal LAN
lt-0/0/0.101 - 10.77.77.101/30 - Attached to default routing instance
lt-0/0/0.102 - 10.77.77.102/30 - Attached to VPN routing instance
st0.100 - 10.255.0.100/32 - IPSEC tunnel to remote device
我有一台测试计算机 (A) 位于 10.10.10.2/24 和测试防火墙通过 fe-0/0/1.0 连接到 192.168.218.1
我在两个设备之间有一个 IPSEC 隧道,它是一个简单的基于路由的隧道,工作正常。问题是我需要访问网络 1.1.1.0/30 上的远程设备,该网络与我在 fe-0/0/0.0 上的网络重叠。不幸的是,这不是重新 IP 的选项,因为这只是一个测试实验室,我有一个更大的设备,带有 100 多个 VPN 和许多我无法控制的重叠网络。
我构建的配置基本上为 2.2.2.0/30 -> 1.1.1.0/30 执行目标 NAT。为了让流量正确路由,我的默认路由实例中有一条路由,如下所示
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
2.2.2.0/30 *[Static/5] 00:31:48
> to 10.77.77.102 via lt-0/0/0.101
这样做的好处是,通过 lt 接口路由的任何流量都会导致它达到我的 NAT 规则,并在我的 vpn 路由实例中执行路由查找,然后将流量路由出隧道接口。
Total destination-nat rules: 1
Total referenced IPv4/IPv6 ip-prefixes: 1/0
Destination NAT rule: DNAT-1 Rule-set: t
Rule-Id : 1
Rule position : 1
From routing instance : vpn
Destination addresses : 2.2.2.0 - 2.2.2.3
vpn.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.0/30 *[Static/5] 05:04:34
> via st0.100
10.10.10.0/24 *[Static/5] 00:34:52
> to 10.77.77.101 via lt-0/0/0.102
这意味着我可以从我的计算机 (10.10.10.2) ping 2.2.2.1 并且它将通过 lt 接口正确地通过两个路由表并沿着隧道向下传输到远程重叠网络。
Jul 31 17:05:28 Gareth-FW RT_FLOW: RT_FLOW_SESSION_CREATE: session created 10.10.10.2/1->2.2.2.1/21042 icmp 10.10.10.2/1->2.2.2.1/21042 None None 1 allow_all(global) trust trust 8502 N/A(N/A) fe-0/0/7.0 UNKNOWN UNKNOWN UNKNOWN
Jul 31 17:05:28 Gareth-FW RT_FLOW: RT_FLOW_SESSION_CREATE: session created 10.10.10.2/1->2.2.2.1/21042 icmp 10.10.10.2/1->1.1.1.1/21042 None DNAT-1 1 allow_all(global) vpn vpn 8503 N/A(N/A) lt-0/0/0.102 UNKNOWN UNKNOWN UNKNOWN
最后是实际问题
这一切在我的测试 SRX 100 上都非常有效。我现在想将它部署到运行 JUNOS 12.1X46-D10.2 的 SRX 240 集群,我立即发现您无法拥有 lt 接口!
有没有办法可以使用其他接口或方法来复制此配置来路由我的流量?如果可能,我想避免使用物理接口。
谢谢
SRX 配置
我省略了 IPSEC 配置,因为它只是一个简单的配置
root@Gareth-FW# show interfaces
fe-0/0/0 {
unit 0 {
family inet {
address 172.30.1.100/24 {
preferred;
}
address 1.1.1.1/30;
}
}
}
lt-0/0/0 {
unit 101 {
encapsulation ethernet;
peer-unit 102;
family inet {
address 10.77.77.101/30;
}
}
unit 102 {
encapsulation ethernet;
peer-unit 101;
family inet {
address 10.77.77.102/30;
}
}
}
fe-0/0/1 {
unit 0 {
family inet {
address 192.168.218.240/24;
}
}
}
fe-0/0/7 {
unit 0 {
family inet {
address 10.10.10.1/24;
}
}
}
st0 {
unit 100 {
family inet {
address 10.255.0.100/32;
}
}
}
root@Gareth-FW# show routing-options
static {
route 2.2.2.0/30 next-hop 10.77.77.102;
}
root@Gareth-FW# show routing-instances
vpn {
instance-type virtual-router;
interface lt-0/0/0.102;
interface lo0.101; ## 'lo0.101' is not defined
interface st0.100;
routing-options {
static {
route 1.1.1.0/30 next-hop st0.100;
route 10.10.10.0/24 next-hop 10.77.77.101;
}
router-id 10.200.0.2;
}
}
root@Gareth-FW# show security nat
destination {
pool test {
address 1.1.1.0/30;
}
rule-set t {
from routing-instance vpn;
rule DNAT-1 {
match {
destination-address 2.2.2.0/30;
}
then {
destination-nat {
pool {
test;
}
}
}
}
}
}