Lsw7
Enter system view, return user view with Ctrl+Z. [Huawei]sysname lsw7
[lsw7]vlan batch 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw7]interface ethernet 0/0/3
[lsw7-Ethernet0/0/3]port link-type access [lsw7-Ethernet0/0/3]port default vlan 10 [lsw7-Ethernet0/0/3]interface ethernet 0/0/4 [lsw7-Ethernet0/0/4]
[lsw7-Ethernet0/0/4]port link-type access [lsw7-Ethernet0/0/4]port default vlan 20 [lsw7-Ethernet0/0/4]interface ethernet 0/0/5 [lsw7-Ethernet0/0/5]port link-type access [lsw7-Ethernet0/0/5]port default vlan 30 [lsw7-Ethernet0/0/5]interface ethernet 0/0/6 [lsw7-Ethernet0/0/6]port link-type access [lsw7-Ethernet0/0/6]port default vlan 40 [lsw7-Ethernet0/0/6]q [lsw7]interface eth-trunk 0
[lsw7-Eth-Trunk0]port link-type trunk
[lsw7-Eth-Trunk0]port trunk allow-pass vlan 10 20 30 40 [lsw7-Eth-Trunk0]interface ethernet 0/0/1 [lsw7-Ethernet0/0/1]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw7-Ethernet0/0/1]interface ethernet 0/0/2 [lsw7-Ethernet0/0/2]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw7-Ethernet0/0/2]
Lsw5
Enter system view, return user view with Ctrl+Z. [Huawei]sysname lsw5
[lsw5]interface eth-trunk 0
[lsw5-Eth-Trunk0]port link-type trunk
[lsw5-Eth-Trunk0]port trunk allow-pass vlan 10 20 30 40
[lsw5-Eth-Trunk0]q
[lsw5]interface ethernet 0/0/2 [lsw5-Ethernet0/0/2]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw5-Ethernet0/0/2]interface ethernet 0/0/3 [lsw5-Ethernet0/0/3]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw5]vlan batch 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment...done. [lsw5]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done. [lsw5]interface vlanif 10
[lsw5-Vlanif10]ip address 172.16.1.1 24 Error: The address already exists. [lsw5-Vlanif10]dhcp select interface
[lsw5-Vlanif10]dhcp server dns-list 222.88.88.88 [lsw5-Vlanif10]dhcp server lease day 20 [lsw5-Vlanif10]q
[lsw5]interface vlanif 20
[lsw5-Vlanif20]ip address 172.16.2.1 24 [lsw5-Vlanif20]dhcp select interface
[lsw5-Vlanif20]dhcp server dns-list 222.88.88.88 [lsw5-Vlanif20]dhcp server lease day 20 [lsw5-Vlanif20]q
[lsw5]interface vlanif 30
[lsw5-Vlanif30]ip address 172.16.3.1 24 [lsw5-Vlanif30]dhcp select interface
[lsw5-Vlanif30]dhcp server dns-list 222.88.88.88 [lsw5-Vlanif30]dhcp server lease day 20 [lsw5-Vlanif30]q
[lsw5]interface vlanif 40
[lsw5-Vlanif40]ip address 172.16.4.1 24 [lsw5-Vlanif40]dhcp select interface
[lsw5-Vlanif40]dhcp server dns-list 222.88.88.88 [lsw5-Vlanif40]dhcp server lease day 20 [lsw5-Vlanif40]q [lsw5]
[lsw5-Ethernet0/0/3]vlan 2 [lsw5-vlan2]interface vlanif 2 [lsw5-Vlanif2]ip address 10.0.0.1 30 [lsw5-Vlanif2]q
[lsw5]interface g0/0/2
[lsw5-GigabitEthernet0/0/2]port link-type access [lsw5-GigabitEthernet0/0/2]port default vlan 2 [lsw5-GigabitEthernet0/0/2]interface vlanif 2 [lsw5-Vlanif2]isis enable
[lsw5-Vlanif2]interface vlanif 10 [lsw5-Vlanif10]isis enable
[lsw5-Vlanif10]interface vlanif 20 [lsw5-Vlanif20]isis enable
[lsw5-Vlanif20]interface vlanif 30 [lsw5-Vlanif30]isis enable
[lsw5-Vlanif30]interface vlanif 40 [lsw5-Vlanif40]isis enable [lsw5-Vlanif40]
AR7
Info: Current terminal monitor is off.
Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR7 [AR7]isis
[AR7-isis-1]network-e
[AR7-isis-1]network-entity 86.0000.0100.0000.0002.00 [AR7-isis-1]is-level level-1
Info: IS Level Changed, Resetting ISIS... [AR7-isis-1]q
[AR7]interface g0/0/2
[AR7-GigabitEthernet0/0/2]ip address 10.0.0.2 30 [AR7-GigabitEthernet0/0/2]isis enable [AR7-GigabitEthernet0/0/2]interface g0/0/0 [AR7-GigabitEthernet0/0/0]isis enable [AR7-GigabitEthernet0/0/0]interface g0/0/1 [AR7-GigabitEthernet0/0/1]isis enable [AR7-GigabitEthernet0/0/1]q [AR7]dis ip rou
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/30 Direct 0 0 D 10.0.0.2 GigabitEthernet 0/0/2
10.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/2
10.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/2
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.1.0/24 ISIS-L1 15 20 D 10.0.0.1 GigabitEthernet 0/0/2
172.16.2.0/24 ISIS-L1 15 20 D 10.0.0.1 GigabitEthernet 0/0/2
172.16.3.0/24 ISIS-L1 15 20 D 10.0.0.1 GigabitEthernet 0/0/2
172.16.4.0/24 ISIS-L1 15 20 D 10.0.0.1 GigabitEthernet 0/0/2
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
三层LSW1交换机配置如下:
Enter system view, return user view with Ctrl+Z. [LSW1]sysname LSW1
[LSW1]vlan batch 3 4 50 60
Info: This operation may take a few seconds. Please wait for a moment...done. [LSW1]interface vlanif 3
[LSW1-Vlanif3]ip address 10.0.0.14 30 [LSW1-Vlanif3]interface ethernet 0/0/3 [LSW1-Ethernet0/0/3]port link-type access [LSW1-Ethernet0/0/3]port default vlan 3
[LSW1-Ethernet0/0/3]interface vlanif 4 [LSW1-Vlanif4]ip address 10.0.0.21 30 [LSW1-Vlanif4]interface ethernet 0/0/1 [LSW1-Ethernet0/0/1]port link-type access [LSW1-Ethernet0/0/1]port default vlan 4 [LSW1-Ethernet0/0/1]interface ethernet 0/0/4 [LSW1-Ethernet0/0/4]port link-type trunk
[LSW1-Ethernet0/0/4]port trunk allow-pass vlan 50 [LSW1-Ethernet0/0/4]interface ethernet 0/0/2 [LSW1-Ethernet0/0/2]port link-type trunk
[LSW1-Ethernet0/0/2]port trunk allow-pass vlan 60 [LSW1-Ethernet0/0/2]q 配置DHCP:
[LSW1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done. [LSW1]interface vlanif 50
[LSW1-Vlanif50]ip address 172.16.5.1 24 [LSW1-Vlanif50]dhcp select interface
[LSW1-Vlanif50]dhcp server dns-list 222.88.88.88 [LSW1-Vlanif50]dhcp server lease day 20 [LSW1-Vlanif50]interface vlanif 60 [LSW1-Vlanif60]ip address 172.16.6.1 24 [LSW1-Vlanif60]dhcp select interface
[LSW1-Vlanif60]dhcp server dns-list 222.88.88.88 [LSW1-Vlanif60]dhcp server lease day 20 [LSW1-Vlanif60]q
之后在客户端pc1、pc2查看获取到的IP地址如下命令:
Pc1ip地址:
Link local IPv6 address...........: fe80::5689:98ff:fefc:6ee1 IPv6 address......................: :: / 128 IPv6 gateway......................: ::
IPv4 address......................: 172.16.5.254 Subnet mask.......................: 255.255.255.0 Gateway...........................: 172.16.5.1
Physical address..................: 54-89-98-FC-6E-E1 DNS server........................: Pc2IP地址: pc>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fef7:19d6 IPv6 address......................: :: / 128 IPv6 gateway......................: ::