Requirements
You must connect the logical systems by using logical tunnel (lt) interfaces. See Example:
Connecting Logical Systems Within the Same Router Using Logical Tunnel Interfaces.
Configuration
1. Basic & interface address configuration.
set system host-name JNCIE
set system root-authentication encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."
set logical-systems R1 interfaces em1 unit 12 vlan-id 12
set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24
set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32
set logical-systems R2 interfaces em2 unit 12 vlan-id 12
set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24
set logical-systems R2 interfaces em2 unit 23 vlan-id 23
set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24
set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32
set logical-systems R3 interfaces em3 unit 23 vlan-id 23
set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24
set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/32
set interfaces em1 vlan-tagging
set interfaces em2 vlan-tagging
set interfaces em3 vlan-tagging
2. Configure R1 using default route and next hop is R2 interface em2.12
set logical-systems R1 routing-options static route 0.0.0.0/0 next-hop 8.8.12.2
3. Configure R2 using static route.
set logical-systems R2 routing-options static route 1.1.1.1/32 next-hop 8.8.12.1
set logical-systems R2 routing-options static route 3.3.3.3/32 next-hop 8.8.23.3
4. Configure R3 using default route and next hop is R2 interface em2.23
set logical-systems R3 routing-options static route 0.0.0.0/0 next-hop 8.8.23.2
5. Commit the configuration.
commit
Verification
Routing Table:
root@JNCIE> show route logical-system R1
inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:02:50
> to 8.8.12.2 via em1.12
1.1.1.1/32 *[Direct/0] 00:56:44
> via lo0.1
8.8.12.0/24 *[Direct/0] 00:02:50
> via em1.12
8.8.12.1/32 *[Local/0] 00:02:50
Local via em1.12
root@JNCIE> show route logical-system R2
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.1/32 *[Static/5] 00:03:11
> to 8.8.12.1 via em2.12
2.2.2.2/32 *[Direct/0] 00:57:05
> via lo0.2
3.3.3.3/32 *[Static/5] 00:03:11
> to 8.8.23.3 via em2.23
8.8.12.0/24 *[Direct/0] 00:03:11
> via em2.12
8.8.12.2/32 *[Local/0] 00:03:11
Local via em2.12
8.8.23.0/24 *[Direct/0] 00:03:11
> via em2.23
8.8.23.2/32 *[Local/0] 00:03:11
Local via em2.23
root@JNCIE> show route logical-system R3
inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:03:13
> to 8.8.23.2 via em3.23
3.3.3.3/32 *[Direct/0] 00:57:07
> via lo0.3
8.8.23.0/24 *[Direct/0] 00:03:13
> via em3.23
8.8.23.3/32 *[Local/0] 00:03:13
Local via em3.23
Ping
root> ping 2.2.2.2 logical-system R1 rapid
PING 2.2.2.2 (2.2.2.2): 56 data bytes
!!!!!
--- 2.2.2.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.148/0.274/0.716/0.221 ms
root>
root> ping 8.8.23.3 logical-system R1 rapid
PING 8.8.23.3 (8.8.23.3): 56 data bytes
!!!!!
--- 8.8.23.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.302/0.395/0.459/0.053 ms
root>
root> ping 3.3.3.3 logical-system R1 rapid
PING 3.3.3.3 (3.3.3.3): 56 data bytes
!!!!!
--- 3.3.3.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.331/0.390/0.484/0.058 ms
root>
root> ping 1.1.1.1 logical-system R2 rapid
PING 1.1.1.1 (1.1.1.1): 56 data bytes
!!!!!
--- 1.1.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.127/0.205/0.324/0.069 ms
root>
root> ping 3.3.3.3 logical-system R2 rapid
PING 3.3.3.3 (3.3.3.3): 56 data bytes
!!!!!
--- 3.3.3.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.149/0.240/0.322/0.076 ms
root>
root> ping 1.1.1.1 logical-system R3 rapid
PING 1.1.1.1 (1.1.1.1): 56 data bytes
!!!!!
--- 1.1.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.277/1.036/3.037/1.033 ms
root>
root> ping 8.8.12.2 logical-system R3 rapid
PING 8.8.12.2 (8.8.12.2): 56 data bytes
!!!!!
--- 8.8.12.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.188/0.261/0.376/0.067 ms
root>
root> ping 2.2.2.2 logical-system R3 rapid
PING 2.2.2.2 (2.2.2.2): 56 data bytes
!!!!!
--- 2.2.2.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.149/0.229/0.319/0.059 ms
root>
Final configuration
root@JNCIE> show configuration | display set
set version 12.1R1.9
set system host-name JNCIE
set system root-authentication encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set logical-systems R1 interfaces em1 unit 12 vlan-id 12
set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24
set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32
set logical-systems R1 routing-options static route 0.0.0.0/0 next-hop 8.8.12.2
set logical-systems R2 interfaces em2 unit 12 vlan-id 12
set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24
set logical-systems R2 interfaces em2 unit 23 vlan-id 23
set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24
set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32
set logical-systems R2 routing-options static route 1.1.1.1/32 next-hop 8.8.12.1
set logical-systems R2 routing-options static route 3.3.3.3/32 next-hop 8.8.23.3
set logical-systems R3 interfaces em3 unit 23 vlan-id 23
set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24
set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/32
set logical-systems R3 routing-options static route 0.0.0.0/0 next-hop 8.8.23.2
set interfaces em1 vlan-tagging
set interfaces em2 vlan-tagging
set interfaces em3 vlan-tagging
root@JNCIE>
Reference:
Protocol-Independent Routing Properties Configuration Guide (JunOS 12.1)
http://www.juniper.net/techpubs/en_US/junos12.1/information-products/pathway-pages/config-guide-routing/config-guide-static-routing.html#configuration
最初發表 / 最後更新: 2014.02.13 / 2018.06.03
0 comments:
張貼留言