华为模拟器DHCP技术

实验需求:

1.创建VLAN

2.VLAN划分正确

3.主机能自动获取IP地址

以下是实验所需设备及拓扑图:

spacer.gif

一.创建VLAN

以下是详细步骤:

LSW1:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]vlan 10

[Huawei-vlan10]vlan 20

[Huawei-vlan20]

Oct 16 2013 17:07:38-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 5, the

change loop count is 0, and the maximum number of records is 4095.

LSW2:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]vlan 10

[Huawei-vlan10]vlan 20

[Huawei-vlan20]

Oct 16 2013 17:07:58-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 5, the

change loop count is 0, and the maximum number of records is 4095.

二.划分VLAN

LSW1:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]interface Eth0/0/1

[Huawei-Ethernet0/0/1]port link-type access

[Huawei-Ethernet0/0/1]port default vlan 10

[Huawei-Ethernet0/0/1]

Oct 16 2013 17:20:49-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 7, the

change loop count is 0, and the maximum number of records is 4095.

[Huawei-Ethernet0/0/1]int e0/0/3

[Huawei-Ethernet0/0/3]port link-type access

[Huawei-Ethernet0/0/3]port default vlan

Oct 16 2013 17:22:29-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 8, the

change loop count is 0, and the maximum number of records is 4095.

[Huawei-Ethernet0/0/3]port default vlan 20

[Huawei-Ethernet0/0/3]

Oct 16 2013 17:22:39-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 9, the

change loop count is 0, and the maximum number of records is 4095.

LSW2:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]interface Eth0/0/1

[Huawei-Ethernet0/0/1]port link-type access

[Huawei-Ethernet0/0/1]p

[Huawei-Ethernet0/0/1]port de

[Huawei-Ethernet0/0/1]port default vlan 10

[Huawei-Ethernet0/0/1]

Oct 16 2013 17:24:28-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 7, the

change loop count is 0, and the maximum number of records is 4095.

[Huawei-Ethernet0/0/1]int e0/0/2

[Huawei-Ethernet0/0/2]port link-type access

[Huawei-Ethernet0/0/2]port default

Oct 16 2013 17:25:58-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 8, the

change loop count is 0, and the maximum number of records is 4095.

[Huawei-Ethernet0/0/2]port default vlan 20

[Huawei-Ethernet0/0/2]

Oct 16 2013 17:26:08-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 9, the

change loop count is 0, and the maximum number of records is 4095.

注意:用display valn 查看当前划分是否正确,以防出错带来不必要的麻烦

如图所示:

华为模拟器DHCP技术_IP地址_02

华为模拟器DHCP技术_records_03

四.给两台交换机配置网关

以下是详细步骤:

LSW1

[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.30.1

[Huawei]

Oct 16 2013 17:45:59-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 12, the

change loop count is 0, and the maximum number of records is 4095.

LSW2

[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.30.1

[Huawei]

Oct 16 2013 17:46:48-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.

25.191.3.1 configurations have been changed. The current change number is 12, the

change loop count is 0, and the maximum number of records is 4095.

五.在路由器上创建子接口

以下是详细步骤:

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]interface GigabitEthernet 0/0/0.1

[Huawei-GigabitEthernet0/0/0.1]dot1q t

[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10

[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.1.1 24

Oct 16 2013 15:05:30-05:13 Huawei %%01IFNET/4

[Huawei-GigabitEthernet0/0/0.1]/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0.1 has entered the UP state.

[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2

[Huawei-GigabitEthernet0/0/0.2]dot1q termination vid 20

[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.2.1 24

Oct 16 2013 15:07:41-05:13 Huawei %%0

[Huawei-Gigabi1IFNET/4/LINK_STATE(l)[1]:The linetEthernet0/0/0.2] protocol IP on the interface GigabitEthernet0/0/0.2 has entered the UP state.

[Huawei-GigabitEthernet0/0/0.2]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.2]int g0/0/0.3

[Huawei-GigabitEthernet0/0/0.3]dot1q termination vid 1

[Huawei-GigabitEthernet0/0/0.3]ip add 192.168.30.1 24

Oct 16 2013 15:08:28

[Huawei-Gigabit-05:13 HuawEthernetei %%01IFNET/4/LINK_STATE(0/0/0.3]l)[2]:The line protocol IP on the interface GigabitEthernet0/0/0.3 has entered the UP state.

[Huawei-GigabitEthernet0/0/0.3]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.3]

注意别忘了开启ARP MAC地址请求!!!

六.创建DHCP地址池

详细步骤如下:

[Huawei]dhcp enable

Info: The operation may take a few seconds. Please wait for a moment.done.

[Huawei]ip pool CTO

Info: It's successful to create an IP address pool.

[Huawei-ip-pool-CTO]network 192.168.1.0 mask 24

七验证:

如图:

华为模拟器DHCP技术_change_04

华为模拟器DHCP技术_current_05

华为模拟器DHCP技术_IP地址_06

如果VLAN 20的成员没有自动获取DHCP成功,则是单臂路由没有做,做了即可

注意!

做单臂路由别忘了将华为模拟器DHCP技术_模拟器_07也改为中继口,本人在做的时候就忘了,结果造成了不必要的麻烦

就此完成

有错误及时更正