Huawei, Dhcp, Pat, Vlan

Realization function: Pc1 belongs to vlan10, Pc2 belongs to vlan20, the 3-layer switch is configured with a dhcp server, and the router is configured with PAT address translation for intranet users to access the ISP network.

Enter the switch view mode, enter the interface, and change the interface to access mode.

<Huawei>system-view //进入系统视图
[Huawei]interface Ethernet 0/0/1 //进入E0/0/1接口
[Huawei-Ethernet0/0/1]port link-type acces //将接口改为access模式
[Huawei]interface Ethernet 0/0/2 //进入E0/0/2接口
[Huawei-Ethernet0/0/2]port link-type acces //将接口改为access模式
[Huawei-Ethernet0/0/2]quit //退出接口模式

Create Vlan10, Vlan20.

[Huawei]vlan 10 //创建一个名称为10的Vlan
[Huawei-vlan10]port Ethernet 0/0/1 //将E0/0/1接口加入Vlan10
[Huawei]vlan 20 //创建一个名称为20的Vlan
[Huawei-vlan20]port Ethernet 0/0/2 //将E0/0/2接口加入Vlan20
[Huawei-vlan20]quit //退出Vlan模式

Enter the Vlan interface to set the IP

[Huawei]interface Vlanif 10 //进入Vlan10接口
[Huawei-Vlanif10]ip address 192.168.1.1 255.255.255.0 //设置Vlan10接口的IP
[Huawei-Vlanif10]undo shutdown //启动接口
[Huawei]interface Vlanif 20 //进入Vlan20接口
[Huawei-Vlanif20]ip address 192.168.2.1 255.255.255.0 //设置Vlan20接口的IP
[Huawei-Vlanif20]undo shutdown //启动接口

Layer 3 switches configure Dhcp to assign addresses to clients.

[Huawei]dhcp enable //开启DHCP服务
[Huawei]ip pool 1.0 //定义一个名称为1.0的DHCP表
[Huawei-ip-pool-1.0]network 192.168.1.0 mask 255.255.255.0 //定义要分配的地址池
[Huawei-ip-pool-1.0]gateway-list 192.168.1.1 //定义客户机所获取的网关
[Huawei-ip-pool-1.0]dns-list 223.5.5.5 223.6.6.6 //定义要分配的DNS地址
[Huawei]ip pool 2.0 //定义一个名称为2.0的DHCP表
[Huawei-ip-pool-2.0]network 192.168.2.0 mask 255.255.255.0 //定义要分配的地址池
[Huawei-ip-pool-2.0]gateway-list 192.168.2.1 //定义客户机所获取的网关
[Huawei-ip-pool-2.0]dns-list 223.5.5.5 223.6.6.6 //定义要分配的DNS地址
[Huawei-ip-pool-2.0]quit //退出DHCP编辑模式

Enter the vlan interface to enable the Dhcp function of the vlan interface.

[Huawei]interface Vlanif 10 //进入Vlan10接口
[Huawei-Vlanif10]dhcp select global //开启DHCP
[Huawei]interface Vlanif 20 //进入Vlan20接口
[Huawei-Vlanif20]dhcp select global //开启DHCP

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325027821&siteId=291194637