Example: Configuring Independent Preferences for an IPv4 Static Route
The following example configures:
- A static route to
0.0.0.0/8with a next hop through192.168.1.254, with a metric10and preference10.- A static route to
10.0.0.0/8with a next hop through192.168.1.254, with a metric6and preference5.- A static route to
10.0.0.0/8with a next hop through192.168.1.2, with a metric6and preference7.[edit]routing-options {static {defaults {metric 10;preference 10;}route 0.0.0.0/8 {next-hop 192.168.1.254 {retain;no-readvertise;}route 10.0.0.0/8 {next-hop [192.168.1.2];qualified-next-hop 192.168.1.254 {preference 5;}metric 6;preference 7;}}}Example: Configuring Independent Preferences for an IPv6 Static Route
Configure the following qualified next hops:
- A static route to
fec0:1:1:4::/64with a next hop throughfec0:1:1:2::1, with a metric10and preference10.- A static route to
fec0:1:1:5::/64with a next hop throughfec0:1:1:2::2, with a metric6and preference5.- A static route to
fec0:1:1:5::/64with a next hop throughfec0:1:1:2::3, with a metric6and preference7.[edit]routing-options {rib inet6.0 {static {defaults {metric 10;preference 10;}route fec0:1:1:4::/64 {next-hop fec0:1:1:2::1 {retain;no-readvertise;}route fec0:1:1:5::/64 {next-hop fec0:1:1:2::3;qualified-next-hop fec0:1:1:2::2 {preference 5;}metric 6;preference 7;}}}}Example: Configuring Independent Preferences for an Unnumbered Ethernet Interface
The following example configures a static route to
5.5.5.2/32with a next hop through unnumbered Gigabit Ethernet interfacege-0/0/0.0, with a metric5and preference6.[edit]routing-options {static {route 5.5.5.2/32 {qualified-next-hop ge-0/0/0.0 {metric 5;preference 6;}}}}