逻辑路由的接口配置

edit logical-routers
edit r8
set interfaces em1 unit 15 vlan-id 15 family inet address 192.168.15.1/24

或者

set interfaces em1.28   vlan-id 15 family inet address 192.168.28.1/24

 

逻辑路由的默认路由配置:

 

实验拓扑:

R1-----------------4.14--------------------4.13----------------R3-----------------2.5-----------------2.6------------------R4

R1:

edit logical-routers r1
set interface em1 unit 12 vlan-id 12 family inet address 10.0.4.5/30
set interface em3 unit 13 vlan-id 13 family inet address 10.0.4.14/30
edit routing-options
set static route 0.0.0.0/0 next-hop 10.0.4.13

R3:

edit logical-routers r3
set interface em3 unit 31 vlan-id 31 family inet address 10.0.4.13/30
set interface em3 unit 34 vlan-id 34 family inet address 10.0.2.5/30

R4:

edit logical-routers r4
set interface em4 unit 43 vlan-id 43 family inet address 10.0.2.6/30
edit routing-options
set static route 0.0.0.0/0 next-hop 10.0.2.5

 

逻辑路由测试:

gouzhongxing@gouzhongxing> ping 10.0.4.5 logical-router r1
PING 10.0.4.5 (10.0.4.5): 56 data bytes
64 bytes from 10.0.4.5: icmp_seq=0 ttl=64 time=0.549 ms
64 bytes from 10.0.4.5: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 10.0.4.5: icmp_seq=2 ttl=64 time=0.104 ms
64 bytes from 10.0.4.5: icmp_seq=3 ttl=64 time=0.102 ms
64 bytes from 10.0.4.5: icmp_seq=4 ttl=64 time=0.111 ms
64 bytes from 10.0.4.5: icmp_seq=5 ttl=64 time=0.848 ms

----------------------------------------------------------------------------------------------------------------------------------------

 

逻辑路由的静态路由配置:

 

实验拓扑:

 

R1-----------------4.14--------------------4.13----------------R3-----------------2.5-----------------2.6------------------R4

 

R1:

edit logical-routers r1
set interface em1 unit 12 vlan-id 12 family inet address 10.0.4.5/30
set interface em3 unit 13 vlan-id 13 family inet address 10.0.4.14/30
edit routing-options
set static route 10.0.2.0/30 next-hop 10.0.4.13

R3:

edit logical-routers r3
set interface em3 unit 31 vlan-id 31 family inet address 10.0.4.13/30
set interface em3 unit 34 vlan-id 34 family inet address 10.0.2.5/30

R4:

edit logical-routers r4
set interface em4 unit 43 vlan-id 43 family inet address 10.0.2.6/30
edit routing-options
set static route 10.0.4.0/30 next-hop 10.0.2.5

 

逻辑路由测试:


gouzhongxing@gouzhongxing> ping 10.0.4.5 logical-router r1
PING 10.0.4.5 (10.0.4.5): 56 data bytes
64 bytes from 10.0.4.5: icmp_seq=0 ttl=64 time=0.549 ms
64 bytes from 10.0.4.5: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 10.0.4.5: icmp_seq=2 ttl=64 time=0.104 ms
64 bytes from 10.0.4.5: icmp_seq=3 ttl=64 time=0.102 ms
64 bytes from 10.0.4.5: icmp_seq=4 ttl=64 time=0.111 ms
64 bytes from 10.0.4.5: icmp_seq=5 ttl=64 time=0.848 ms

 

---------------------------------------------------------------

 

逻辑路由的RIP路由配置:


实验拓扑:

 

R1-----------------4.14--------------------4.13----------------R3-----------------2.5-----------------2.6------------------R4

 

R1:

edit logical-routers r1
set interface em1 unit 12 vlan-id 12 family inet address 10.0.4.5/30
set interface em3 unit 13 vlan-id 13 family inet address 10.0.4.14/30
edit protocols
set rip group gouzhongxing neighbor em1.13

R3:

edit logical-routers r3
set interface em3 unit 31 vlan-id 31 family inet address 10.0.4.13/30
set interface em3 unit 34 vlan-id 34 family inet address 10.0.2.5/30
edit protocols
set rip group gouzhongxing neighbor em3.31
set rip group gouzhongxing neighbor em3.34

R4:

edit logical-routers r4
set interface em4 unit 43 vlan-id 43 family inet address 10.0.2.6/30
edit protocols
set rip group gouzhongxing neighbor em4.43

删除ospf协议:


delete protocols ospf

 

测试:

gouzhongxing@gouzhongxing> ping 10.0.4.5 logical-router r1
PING 10.0.4.5 (10.0.4.5): 56 data bytes
64 bytes from 10.0.4.5: icmp_seq=0 ttl=64 time=0.549 ms
64 bytes from 10.0.4.5: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 10.0.4.5: icmp_seq=2 ttl=64 time=0.104 ms
64 bytes from 10.0.4.5: icmp_seq=3 ttl=64 time=0.102 ms
64 bytes from 10.0.4.5: icmp_seq=4 ttl=64 time=0.111 ms
64 bytes from 10.0.4.5: icmp_seq=5 ttl=64 time=0.848 ms

 

实验成功。