在屏幕上的命令
set vrouter "trust-vr"
正在让您编辑 trust-vr 路由器部分。trust-vr通常是默认路由实例。下一个命令
set route 80.70.128.142/32 vrouter "UntrustGi-vr" preference 20 metric 1
在 trust-vr 路由表中添加一个条目,说明将所有流量路由到 80.70.128.142/32 到另一个名为“UntrustGi-vr”的虚拟路由实例,优先级为 20,度量为 1
现在取决于您是否已将 trust-vr 路由实例更改为非默认设置,这取决于您将如何在 Junos 中添加它。
如果它是默认路由实例,那么你只需要做
set routing-options static route 80.70.128.142/32 next-table UntrustGi-vr.net.0 preference 20
set routing-options static route 80.70.128.143/32 metric 1
它将静态路由添加到默认路由表 inet.0 中。配置应该是这样的
routing-options {
static {
route 80.70.128.142/32 {
next-table UntrustGi-vr.inet.0;
metric 1;
preference 20;
}
}
}
如果你查看路由表,你会看到这个
inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
80.70.128.142/32 *[Static/20] 00:08:54, metric 1
to table UntrustGi-vr.inet.0
如果它不是默认路由实例并且您创建了一个名为 trust-vr 的路由实例,那么您会这样做
set routing-instance trust-vr routing-options static route 80.70.128.142/32 next-table UntrustGi-vr.net.0 preference 20
set routing-instance trust-vr routing-options static route 80.70.128.142/32 metric 1
配置应该与此类似
routing-instances {
trust-vr {
routing-options {
static {
route 80.70.128.142/32 {
next-table UntrustGi-vr.inet.0;
metric 1;
preference 20;
}
}
}
}
}
并且路由表应该显示这个
trust-vr.inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
80.70.128.142/32 *[Static/20] 00:03:15, metric 1
to table UntrustGi-vr.inet.0