| 华为AR1220入门企业路由组网 
 
 先配置1F、2F、3F二层交换机的VLAN <Huawei>system-view [Huawei]sysname1fsw  //配置设备名称 [1fsw]vlan10  //创建vlan10 [1fsw-vlan10]descriptionshichang  //配置vlan描述 [1fsw-vlan10]quit [1fsw]interfaceEthernet0/0/1  //接口视图 [1fsw-Ethernet0/0/1]portlink-type access  //配置接口链路类型为访问 [1fsw-Ethernet0/0/1]portdefault vlan 10  //配置接口默认vlan [1fsw-Ethernet0/0/1]quit [1fsw]interfaceEthernet 0/0/22 [1fsw-Ethernet0/0/22]portlink-type trunk [1fsw-Ethernet0/0/22]porttrunk allow-pass vlan all [1fsw-Ethernet0/0/22]quit <1fsw>save //保存配置 Thecurrent configuration will be written to the device. Areyou sure to continue?[Y/N]y   <Huawei>system-view [Huawei]sysname2fsw [2fsw]vlan 20 [2fsw-vlan20]description caiwu [2fsw-vlan20]quit [2fsw]interface Ethernet 0/0/1 [2fsw-Ethernet0/0/1]portlink-type access [2fsw-Ethernet0/0/1]portdefault vlan 20 [2fsw-Ethernet0/0/1]quit [2fsw]interface Ethernet 0/0/22 [2fsw-Ethernet0/0/22]portlink-type trunk [2fsw-Ethernet0/0/22]porttrunk allow-pass vlan all [2fsw-Ethernet0/0/22]quit <2fsw>save Thecurrent configuration will be written to the device. Areyou sure to continue?[Y/N]y     <Huawei>system-view [Huawei]sysname 3fsw [3fsw]vlan 30 [3fsw-vlan30]description renshi [3fsw-vlan30]quit [3fsw]interfaceEthernet 0/0/1 [3fsw-Ethernet0/0/1]portlink-type access [3fsw-Ethernet0/0/1]portdefault vlan 30 [3fsw-Ethernet0/0/1]quit [3fsw]interface Ethernet 0/0/22 [3fsw-Ethernet0/0/22]port link-type trunk [3fsw-Ethernet0/0/22]porttrunk allow-pass vlan all [3fsw-Ethernet0/0/22]quit <3fsw>save Thecurrent configuration will be written to the device. Areyou sure to continue?[Y/N]y 
   配置接入层交换机到AR1220 LAN接口 <Huawei>system-view [Huawei]sysnameCore Router [CoreRouter]vlan 10 [CoreRouter-vlan10]description shichang [Core Router-vlan10]vlan 20 [Core Router-vlan20]description caiwu [Core Router-vlan20]vlan 30 [Core Router-vlan30]description renshi [Core Router-vlan30]quit [CoreRouter]interface vlanif 10  //三层转发逻辑接口 [CoreRouter-Vlanif10]ip address 192.168.10.1 24 //配置三层转发地址 [CoreRouter-Vlanif10]interface vlanif 20 [Core Router-Vlanif20]ip address 192.168.20.1 24 [Core Router-Vlanif20]interface vlanif 30 [Core Router-Vlanif30]ip address 192.168.30.1 24 [Core Router-Vlanif30]interface GigabitEthernet0/0/0 [Core Router-GigabitEthernet0/0/0]ip address172.16.12.2 24 [CoreRouter-GigabitEthernet0/0/0]interface Ethernet 0/0/0  //接口视图 [CoreRouter-Ethernet0/0/0]port link-type trunk  //配置接口链路类型为骨干链路 [CoreRouter-Ethernet0/0/0]port trunk allow-pass vlan 10  //配置接口允许通过VLAN [CoreRouter-Ethernet0/0/0]interface Ethernet 0/0/1 [CoreRouter-Ethernet0/0/1]port link-type trunk [Core Router-Ethernet0/0/1]port trunk allow-passvlan 20 [Core Router-Ethernet0/0/1]interface Ethernet 0/0/2 [Core Router-Ethernet0/0/2]port link-type trunk [Core Router-Ethernet0/0/2]port trunk allow-passvlan 30 [Core Router-Ethernet0/0/2]quit [CoreRouter]ip route-static 0.0.0.0 0.0.0.0 172.16.12.1  //配置默认路由指向下一跳地址 [CoreRouter]display ip interface brief  //查看IP接口简介 *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 5 The number of interface that is DOWN in Physical is1 The number of interface that is UP in Protocol is 5 The number of interface that is DOWN in Protocol is1   Interface                         IP Address/Mask      Physical  Protocol   GigabitEthernet0/0/0              172.16.12.2/24       up         up         GigabitEthernet0/0/1              unassigned           down       down      NULL0                             unassigned           up         up(s)      Vlanif10                          192.168.10.1/24      up        up         Vlanif20                          192.168.20.1/24      up        up         Vlanif30                          192.168.30.1/24      up        up      [CoreRouter]display port vlan active  //查看接口VLAN活跃状态  T=TAG U=UNTAG C=Configured H=HVRP G=GVRPV=VOICE-VLAN E=E-LMI DA=Dynamic-authorization-VLANUU=Unauthenticated-user-VLAN M=Mac-Flapping ------------------------------------------------------------------------------- Port               Link Type    PVID    VLAN List ------------------------------------------------------------------------------- Eth0/0/0            trunk        1(C)   U: 1(C)                                          T:10(C) Eth0/0/1            trunk        1(C)   U: 1(C)                                          T:20(C) Eth0/0/2            trunk        1(C)   U: 1(C)                                          T:30(C) Eth0/0/3           hybrid       1(C)    U: 1(C) Eth0/0/4           hybrid       1(C)    U: 1(C) Eth0/0/5           hybrid       1(C)    U: 1(C) Eth0/0/6           hybrid       1(C)    U:1(C) Eth0/0/7           hybrid       1(C)    U: 1(C)   [Core Router]return  //返回用户视图 <Core Router>save  //保存配置   The currentconfiguration will be written to the device.    Are you sureto continue? (y/n)[n]:y 
   配置Core Router到出口网关 <Huawei>system-view [Huawei]sysname Gateway [Gateway]interface GigabitEthernet 0/0/0 [Gateway-GigabitEthernet0/0/0]ip address 172.16.12.124 [Gateway-GigabitEthernet0/0/0]quit [Gateway]interface loopback 0 [Gateway-LoopBack0]ip address 192.168.100.100 32 [Gateway-LoopBack0]quit [Gateway]ip route-static 0.0.0.0 0.0.0.0 172.16.12.2 [Gateway]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is1 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is1   Interface                         IP Address/Mask      Physical  Protocol   GigabitEthernet0/0/0              172.16.12.1/24       up         up         GigabitEthernet0/0/1              unassigned           down       down      LoopBack0                        192.168.100.100/32   up         up(s)      NULL0                             unassigned           up         up(s    [Gateway]return <Gateway>save   The currentconfiguration will be written to the device.    Are you sureto continue? (y/n)[n]:y 
   测试全网全通(使用PC1测试) PC>ping 192.168.20.100   Ping 192.168.20.100: 32 data bytes, Press Ctrl_C tobreak From 192.168.20.100: bytes=32 seq=1 ttl=127 time=63ms From 192.168.20.100: bytes=32 seq=2 ttl=127 time=62ms From 192.168.20.100: bytes=32 seq=3 ttl=127 time=63ms From 192.168.20.100: bytes=32 seq=4 ttl=127 time=94ms From 192.168.20.100: bytes=32 seq=5 ttl=127 time=78ms   --- 192.168.20.100 ping statistics ---   5 packet(s)transmitted   5 packet(s)received   0.00% packetloss   round-tripmin/avg/max = 62/72/94 ms   PC>ping 192.168.30.100   Ping 192.168.30.100: 32 data bytes, Press Ctrl_C tobreak From 192.168.30.100: bytes=32 seq=1 ttl=127 time=78ms From 192.168.30.100: bytes=32 seq=2 ttl=127 time=78ms From 192.168.30.100: bytes=32 seq=3 ttl=127 time=94ms From 192.168.30.100: bytes=32 seq=4 ttl=127 time=78ms From 192.168.30.100: bytes=32 seq=5 ttl=127 time=93ms   --- 192.168.30.100 ping statistics ---   5 packet(s)transmitted   5 packet(s)received   0.00% packetloss   round-tripmin/avg/max = 78/84/94 ms   PC>ping 192.168.100.100   Ping 192.168.100.100: 32 data bytes, Press Ctrl_C tobreak From 192.168.100.100: bytes=32 seq=1 ttl=254 time=47ms From 192.168.100.100: bytes=32 seq=2 ttl=254 time=31ms From 192.168.100.100: bytes=32 seq=3 ttl=254 time=47ms From 192.168.100.100: bytes=32 seq=4 ttl=254 time=63ms From 192.168.100.100: bytes=32 seq=5 ttl=254 time=78ms   --- 192.168.100.100 ping statistics ---   5 packet(s)transmitted   5 packet(s)received   0.00% packetloss   round-tripmin/avg/max = 31/53/78 ms   PC>ping 172.16.12.2   Ping 172.16.12.2: 32 data bytes, Press Ctrl_C tobreak From 172.16.12.2: bytes=32 seq=1 ttl=255 time=31 ms From 172.16.12.2: bytes=32 seq=2 ttl=255 time=47 ms From 172.16.12.2: bytes=32 seq=3 ttl=255 time=47 ms From 172.16.12.2: bytes=32 seq=4 ttl=255 time=31 ms From 172.16.12.2: bytes=32 seq=5 ttl=255 time=47 ms   --- 172.16.12.2 ping statistics ---   5 packet(s)transmitted   5 packet(s)received   0.00% packetloss   round-tripmin/avg/max = 31/40/47 ms   测试全网全通OK。 |