瞻博网络 JUNOS 中的 Cisco Route Map 等效项

网络工程 思科 杜松
2021-07-22 15:19:40

这是策略基础路由的场景和工作路由映射示例。
我是新的 Junos,我正在努力处理 Junos 中的防火墙过滤器和策略声明。

你能帮我把这个简单的场景从 Cisco IOS 转换成 JUNOS 等价的吗?

它在下面做什么匹配来自除目的地 200.100.30.248/29 之外的任何源的数据包,并将其下一跳设置为 192.168.1.1

使用访问列表匹配条件

access-list 104 permit ip any 202.100.30.248 0.0.0.7 log-input

路线地图

route-map PBR permit 10
 match ip address 104
 set ip default next-hop 192.168.1.1

并在最后应用它。

interface FastEthernet0/1  
 ip address 172.16.1.2 255.255.255.252  
 ip policy route-map PBR
1个回答

JunOS 中的此功能称为基于过滤器的转发您可以在此处找到 MX 平台的配置示例此处为SRX 平台上的双 ISP 路由示例

这里也是 SRX 平台的工作示例。我们有网络,流量应该通过非默认路由路由,本地目标网络除外。

user@srx1400> show route 0/0 exact

inet.0: 450 destinations, 474 routes (450 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 69w5d 17:17:29
                    > to 111.111.111.111 via ge-0/0/1.0

接口,源地址位于其后面:

user@srx1400> show configuration interfaces ge-0/0/2.100

description "SRV";
vlan-id 100;
family inet {
    filter {
        input ge-0/0/1.100-in;
    }
    address 192.168.100.1/24;
}

防火墙过滤器:

user@srx1400> show configuration firewall filter ge-0/0/1.100-in

term inject-default {
    from {
        source-address {
            192.168.100.0/24;
        }
        destination-address {
            10.0.0.0/8 except;
            172.16.0.0/12 except;
            192.168.0.0/16 except;
            0.0.0.0/0;
        }
    }
    then {
        routing-instance ri_fw_injdefault;
    }
}
term default {
    then accept;
}

路由实例配置:

user@srx1400> show configuration routing-instances ri_fw_injdefault

instance-type forwarding;
routing-options {
    static {
        route 0.0.0.0/0 next-hop 222.222.222.222;
    }
}

设置 RIB 组:

user@srx1400> show configuration routing-options

interface-routes {
    rib-group inet fbf-group;
}
static {
...
}
rib-groups {
    fbf-group {
        import-rib [ inet.0 ri_fw_injdefault.inet.0 ];
    }

}

设置完成后,让我们检查ri_fw_injdefault实例的路由表

user@srx1400> show route 0/0 exact table ri_fw_injdefault.inet.0

ri_fw_injdefault.inet.0: 81 destinations, 81 routes (81 active, 0 holddown, 
0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 38w1d 00:19:55
                    > to 222.222.222.222 via ge-0/0/3.0