Olive邏輯路由器互連與Loopback0 設定練習
Lab練習目的
1. 瞭解邏輯路由器介面分配方式
2. 學習設定邏輯路由器R1, R2, R3
3. 基本check指令
1. 瞭解邏輯路由器介面分配方式
先講概念
參考以下附圖, 此為我VMware setting
VMware內分配4張網卡Network Adapter 是計劃給實體路由器使用Network Adapter 1是計劃給邏輯路由器R1使用Network Adapter 2是計劃給邏輯路由器R2使用Network Adapter 3是計劃給邏輯路由器R3使用Network Adapter 為Bridged mode以後實體路由器能夠與本機PC或其餘VMware互連Network Adapter 1, 2, 3 屬於VMnet1 (DHCP disable)讓R1-3的介面互連但又透過VLAN來區隔因此連進實體路由器之後 會看到以下顯示em0即是VMware的Network Adapterem1即是VMware的Network Adapter 1em2即是VMware的Network Adapter 2em3即是VMware的Network Adapter 3root> show interfaces terse Interface Admin Link Proto Local Remotecbp0 up up demux0 up up dsc up up em0 up up em1 up up em2 up up em3 up up gre up up ipip up up irb up up lo0 up up lo0.16384 up up inet 127.0.0.1 --> 0/0lo0.16385 up up inet 128.0.0.4 --> 0/0 inet6 fe80::20c:290f:fc76:19b8lsi up up mtun up up pimd up up pime up up pip0 up up pp0 up up tap up up root>注意:同一個em介面 能夠同時給多個邏輯路由器使用但不能夠有重複VLAN-ID例如: R1 能夠用em1, R2也能夠用em1但若是R1 link to R2R1 em1.12 (VLAN-ID 12) link to R2 em1.12 (VLAN-ID 12)這樣是不能夠的 因為em1 重複了兩個相同的VALN-ID 12在R1 & R22. 學習設定邏輯路由器R1, R2, R3a. 設定root密碼, 否則無法commitset system root-authentication plain-text-passwordb. Enable em1-3 support 802.1q vlan tag functionset interfaces em1 vlan-tagging set interfaces em2 vlan-tagging set interfaces em3 vlan-tagging c. Setting R1 link (VLAN 12) and loopback0.1set logical-systems R1 interfaces em1 unit 12 vlan-id 12set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32d. Setting R2 link (VLAN 12 & VLAN 23) and loopback0.2set logical-systems R2 interfaces em2 unit 12 vlan-id 12set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24set logical-systems R2 interfaces em2 unit 23 vlan-id 23set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32e. Setting R3 link (VLAN23) and loopback0.3set logical-systems R3 interfaces em3 unit 23 vlan-id 23set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/323. 基本check指令a. Check interfaceroot> show interfaces terse Interface Admin Link Proto Local Remotecbp0 up up demux0 up up dsc up up em0 up up em1 up up em1.12 up up inet 8.8.12.1/24 em2 up up em2.12 up up inet 8.8.12.2/24 em2.23 up up inet 8.8.23.2/24 em3 up up em3.23 up up inet 8.8.23.3/24 gre up up ipip up up irb up up lo0 up up lo0.1 up up inet 1.1.1.1 --> 0/0lo0.2 up up inet 2.2.2.2 --> 0/0lo0.3 up up inet 3.3.3.3 --> 0/0lo0.16384 up up inet 127.0.0.1 --> 0/0lo0.16385 up up inet 128.0.0.4 --> 0/0 inet6 fe80::20c:290f:fc76:19b8lsi up up mtun up up pimd up up pime up up pip0 up up pp0 up up tap up up root> a. R1 ping R2 interfaceroot> ping 8.8.12.2 logical-system R1 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 lossround-trip min/avg/max/stddev = 0.134/0.220/0.463/0.123 msroot>b. R1 ping R1 loopbacklo0.1root> ping 1.1.1.1 logical-system R1 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 lossround-trip min/avg/max/stddev = 0.022/0.030/0.057/0.014 msroot>c. R2 ping R1 interfaceroot> ping 8.8.12.1 logical-system R2 rapid PING 8.8.12.1 (8.8.12.1): 56 data bytes!!!!!--- 8.8.12.1 ping statistics ---5 packets transmitted, 5 packets received, 0% packet lossround-trip min/avg/max/stddev = 0.137/0.167/0.231/0.034 msroot> d. R2 ping R3 interfaceroot> ping 8.8.23.3 logical-system R2 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 lossround-trip min/avg/max/stddev = 0.131/0.221/0.507/0.145 msroot>e. R2 ping R2 loopbacklo0.2root> ping 2.2.2.2 logical-system R2 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 lossround-trip min/avg/max/stddev = 0.023/0.036/0.058/0.014 msroot>f. R3 ping R2 interfaceroot> ping 8.8.23.2 logical-system R3 rapid PING 8.8.23.2 (8.8.23.2): 56 data bytes!!!!!--- 8.8.23.2 ping statistics ---5 packets transmitted, 5 packets received, 0% packet lossround-trip min/avg/max/stddev = 0.141/0.156/0.199/0.022 msroot>g. R3 ping R3 loopbacklo0.3root> ping 3.3.3.3 logical-system R3 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 lossround-trip min/avg/max/stddev = 0.022/0.029/0.050/0.011 msroot>Final config:root# show ## Last changed: 2014-02-07 15:19:47 UTCversion 12.1R1.9;system { root-authentication { encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."; ## SECRET-DATA } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } }}logical-systems { R1 { interfaces { em1 { unit 12 { vlan-id 12; family inet { address 8.8.12.1/24; } } } lo0 { unit 1 { family inet { address 1.1.1.1/32; } } } } } R2 { interfaces { em2 { unit 12 { vlan-id 12; family inet { address 8.8.12.2/24; } } unit 23 { vlan-id 23; family inet { address 8.8.23.2/24; } } } lo0 { unit 2 { family inet { address 2.2.2.2/32; } } } } } R3 { interfaces { em3 { unit 23 { vlan-id 23; family inet { address 8.8.23.3/24; } } } lo0 { unit 3 { family inet { address 3.3.3.3/32; } } } } }}interfaces { em1 { vlan-tagging; } em2 { vlan-tagging; } em3 { vlan-tagging; }}[edit]root#Final config (display set)root# show | display set set version 12.1R1.9set system root-authentication encrypted-password "$1$Luohd5lf$6ikSsNi1iEX/147eHbqm7."set system syslog user * any emergencyset system syslog file messages any noticeset system syslog file messages authorization infoset system syslog file interactive-commands interactive-commands anyset logical-systems R1 interfaces em1 unit 12 vlan-id 12set logical-systems R1 interfaces em1 unit 12 family inet address 8.8.12.1/24set logical-systems R1 interfaces lo0 unit 1 family inet address 1.1.1.1/32set logical-systems R2 interfaces em2 unit 12 vlan-id 12set logical-systems R2 interfaces em2 unit 12 family inet address 8.8.12.2/24set logical-systems R2 interfaces em2 unit 23 vlan-id 23set logical-systems R2 interfaces em2 unit 23 family inet address 8.8.23.2/24set logical-systems R2 interfaces lo0 unit 2 family inet address 2.2.2.2/32set logical-systems R3 interfaces em3 unit 23 vlan-id 23set logical-systems R3 interfaces em3 unit 23 family inet address 8.8.23.3/24set logical-systems R3 interfaces lo0 unit 3 family inet address 3.3.3.3/32set interfaces em1 vlan-taggingset interfaces em2 vlan-taggingset interfaces em3 vlan-tagging[edit]root#