拓补图:
实验环境:一台路由器,两台交换机,四台pc机
需求:
左边两台PC 自动分配 IP为1.0网段
右边两台PC 自动分配 2.0 网段,
路由器配置命令
左边接口
分配1.0网段地址
[Huawei]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [Huawei]int g0/0/0 [Huawei-GigabitEthernet0/0/0]ip add 192.168.1.1 24 [Huawei-GigabitEthernet0/0/0]dhcp select interface 开启接口dhcp功能***
测试
PC开启DHCP自动获取
右边接口
分配2.0网段地址
[Huawei]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/0]ip add 192.168.2.1 24 [Huawei-GigabitEthernet0/0/0]dhcp select interface 开启接口dhcp功能***
测试
PC开启DHCP自动获取