拓扑图:
需求:
PC1
和
PC2
主机访问
http
服务走
ge-0/0/0
(
wan1
),访问
telnet
服务走
ge-0/0/1
(
wan2
)。其余走
ge-
0/0/0
(
wan1
)。
配置过程:
第一步,创建路由实例
(routing-instance)
set routing-instances
wan1
instance-type
forwarding
set routing-instances
wan1
routing-options static route
0.0.0.0/0
next-hop
202.100.1.1
set routing-instances
wan2
instance-type
forwarding
set routing-instances
wan2
routing-options static route
0.0.0.0/0
next-hop
202.100.2.1
wan1
:路由实例的名称
forwarding
:路由实例的类型
PS
:每一个路由实例可以理解为一个单独的路由转发表。
第二步:设置路由信息组(
rib-groups
)
set routing-options rib-groups
routing_table_group
import-rib
inet.0
set routing-options rib-groups
routing_table_group
import-rib
wan1.inet.0
set routing-options rib-groups
routing_table_group
import-rib
wan2.inet.0
说明:
routing_table_group
:路由信息组名称
wan1.inet.0
:如果
wan1
的话,它的路由转发表的命名就是
wan1.inet.0
,是自动生成的。
PS:As the two ISPs are part of inet.0, the rib-group configuration is required to import the directly
connected routes of the ISP into the routing-instance. (
来自官方解释
)
意思就是需要将直连的路由输入到路由实例中。