HCNA-10 利用单臂由实现VLAN间路由
1、 配置各交换机基本配及VLAN <Huawei>clocktimezone BJ add 8:00:00 <Huawei>clockdatetime 18:00 2020-05-02 <Huawei>system-view [sw3]vlan10 //创建VLAN10 [sw3-vlan10]descriptionIT //描述为IT [sw3-vlan10]quit [sw3]vlan20 [sw3-vlan20]descriptionshichang [sw3-vlan20]quit [sw3]interfaceGigabitEthernet 0/0/1 [sw3-GigabitEthernet0/0/1]undonegotiation auto //接口不执行自动协议 [sw3-GigabitEthernet0/0/1]duplexfull //配置接口为全双工模式 [sw3-GigabitEthernet0/0/1]speed1000 //配置接口速率为1000M [sw3-GigabitEthernet0/0/1]portlink-type access //配置接口链路为access [sw3-GigabitEthernet0/0/1]portdefault vlan 10 //配置接口默认VLAN [sw3-GigabitEthernet0/0/1]quit [sw3]interfaceGigabitEthernet 0/0/2 [sw3-GigabitEthernet0/0/2]undonegotiation auto [sw3-GigabitEthernet0/0/2]duplexfull [sw3-GigabitEthernet0/0/2]speed1000 [sw3-GigabitEthernet0/0/2]portlink-type access [sw3-GigabitEthernet0/0/2]portdefault vlan 20 [sw3-GigabitEthernet0/0/2]quit [sw3]interfaceGigabitEthernet 0/0/24 [sw3-GigabitEthernet0/0/24]undonegotiation auto [sw3-GigabitEthernet0/0/24]duplexfull [sw3-GigabitEthernet0/0/24]speed1000 [sw3-GigabitEthernet0/0/24]portlink-type trunk [sw3-GigabitEthernet0/0/24]porttrunk allow-pass vlan all [sw3-GigabitEthernet0/0/24]return <sw3>save <Huawei>clocktimezone BJ add 8:00:00 <Huawei>clockdatetime 18:09 2020-05-02 <Huawei>system-view [Huawei]sysnamesw2 [sw2]vlan30 [sw2-vlan30]descriptioncaiwu [sw2-vlan30]quit [sw2]interfaceGigabitEthernet 0/0/1 [sw2-GigabitEthernet0/0/1]undonegotiation auto [sw2-GigabitEthernet0/0/1]duplexfull [sw2-GigabitEthernet0/0/1]speed1000 [sw2-GigabitEthernet0/0/1]portlink-type access [sw2-GigabitEthernet0/0/1]portdefault vlan 30 [sw2-GigabitEthernet0/0/1]quit [sw2]interfaceGigabitEthernet 0/0/24 [sw2-GigabitEthernet0/0/24]undonegotiation auto [sw2-GigabitEthernet0/0/24]duplexfull [sw2-GigabitEthernet0/0/24]speed1000 [sw2-GigabitEthernet0/0/24]portlink-type trunk [sw2-GigabitEthernet0/0/24]porttrunk allow-pass vlan all [sw2-GigabitEthernet0/0/24]quit [sw2-GigabitEthernet0/0/24]return <sw2>save <Huawei>clocktimezone BJ add 8:00:00 <Huawei>clockdatetime 18:16 2020-05-02 <Huawei>system-view [Huawei]sysnamesw1 [sw1]vlanbatch 10 20 30 [sw1]port-groupgroup-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3 [sw1-port-group]undonegotiation auto [sw1-port-group]duplexfull [sw1-port-group]speed1000 [sw1-port-group]portlink-type trunk [sw1-port-group]porttrunk allow-pass vlan all [sw1-port-group]return <sw1>displayvlan <sw1>displayport vlan active
2、 配置路由器子接口IP地址和子接口封装VLAN <Huawei>clocktimezone BJ add 8:00:00 <Huawei>clockdatetime 18:23 2020-05-02 <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/0.1 //创建GE 0/0/0.1子接口 [r1-GigabitEthernet0/0/0.1]ipaddress 172.16.10.1 24 //配置IP地址 [r1-GigabitEthernet0/0/0.1]dot1qtermination vid 10 //对接口封装VLAN [r1-GigabitEthernet0/0/0.1]arpbroadcast enable //开启ARP广播 [r1-GigabitEthernet0/0/0.1]quit [r1]interfaceGigabitEthernet 0/0/0.2 [r1-GigabitEthernet0/0/0.2]ipaddress 172.16.20.1 24 [r1-GigabitEthernet0/0/0.2]dot1qtermination vid 20 [r1-GigabitEthernet0/0/0.2]arpbroadcast enable [r1-GigabitEthernet0/0/0.2]quit [r1]interfaceGigabitEthernet 0/0/0.3 [r1-GigabitEthernet0/0/0.3]ipaddress 172.16.30.1 24 [r1-GigabitEthernet0/0/0.3]dot1qtermination vid 30 [r1-GigabitEthernet0/0/0.3]arpbroadcast enable [r1-GigabitEthernet0/0/0.3]quit [r1]displayip interface brief //查看IP接口简介 *down:administratively down ^down:standby (l):loopback (s):spoofing The numberof interface that is UP in Physical is 5 The numberof interface that is DOWN in Physical is 2 The numberof interface that is UP in Protocol is 4 The numberof interface that is DOWN in Protocol is 3 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 unassigned up down GigabitEthernet0/0/0.1 172.16.10.1/24 up up GigabitEthernet0/0/0.2 172.16.20.1/24 up up GigabitEthernet0/0/0.3 172.16.30.1/24 up up GigabitEthernet0/0/1 unassigned down down GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [r1]displayip routing-table //查看IP路由表 RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 13 Routes : 13 Destination/Mask Proto Pre Cost Flags NextHop Interface 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.10.0/24 Direct 0 0 D 172.16.10.1 GigabitEthernet 0/0/0.1 172.16.10.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.1 172.16.10.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.1 172.16.20.0/24 Direct 0 0 D 172.16.20.1 GigabitEthernet 0/0/0.2 172.16.20.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.2 172.16.20.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.2 172.16.30.0/24 Direct 0 0 D 172.16.30.1 GigabitEthernet 0/0/0.3 172.16.30.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.3 172.16.30.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0.3 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 [r1]quit <r1>save |