这里拿S5130V2-10P-LI来配置DHCP,官网地址:https://www.h3c.com/cn/Service/Document_Software/Document_Center/Home/Switches/00-Public/Configure/Operation_Manual/H3C_S5130V2_SI_SE_S5130_CG_R3507Pxx-13694/00/
一,网络拓扑图
二,配置阶段
1,交换机相关配置:
#交换的初始化配置telnet服务请看我的另一篇文章华三V7 交换机 Telnet 登录设备方法:https://www.hao0564.com/3779.html
#telnet到交换机S5130V2创建VLAN 10 20 30 40
[创世纪网络工程S5130V2]vlan 10 20 30 40
#给vlan 1 10 20 30 40 配置接口地址,如下图:
#
interface Vlan-interface1
ip address 192.168.22.253 255.255.255.0
dhcp client identifier ascii 1090faf1e3ea-VLAN0001
ipv6 address dhcp-alloc
#
interface Vlan-interface10
ip address 192.168.10.1 255.255.255.0
#
interface Vlan-interface20
ip address 192.168.20.1 255.255.255.0
#
interface Vlan-interface30
ip address 192.168.30.1 255.255.255.0
#
interface Vlan-interface40
ip address 192.168.40.1 255.255.255.0
#
#给vlan 1 10 20 30 40 配置DHCP服务,具体如下:
#
dhcp server ip-pool Vlan-interface1
gateway-list 192.168.22.1
network 192.168.22.0 mask 255.255.255.0
address range 192.168.1.100 192.168.1.200
dns-list 192.168.22.1
#
dhcp server ip-pool vlan10
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
dns-list 192.168.10.1
#
dhcp server ip-pool vlan20
gateway-list 192.168.20.1
network 192.168.20.0 mask 255.255.255.0
dns-list 192.168.20.1
#
dhcp server ip-pool vlan30
gateway-list 192.168.30.1
network 192.168.30.0 mask 255.255.255.0
dns-list 192.168.30.1
#
dhcp server ip-pool vlan40
gateway-list 192.168.40.1
network 192.168.40.0 mask 255.255.255.0
dns-list 192.168.40.1
#
#配置DNS代理服务
#
dns proxy enable
dns server 114.114.114.114
dns server 202.102.192.68
dns server 202.102.199.68
#
lldp global enable
#在交换机S5130V2写一条默认静态路由
#
ip route-static 0.0.0.0 0 192.168.22.1
#
2,路由器相关配置
#在路由器上创建vlan 1 10 20 30 40,并配置虚拟接口地址,如下:
#
interface Vlan-interface1
description LAN-interface
ip address 192.168.22.1 255.255.255.0
tcp mss 1280
undo dhcp select server
#
interface Vlan-interface20
ip address 192.168.20.254 255.255.255.0
#
interface Vlan-interface30
ip address 192.168.30.254 255.255.255.0
#
interface Vlan-interface40
ip address 192.168.40.254 255.255.255.0
#综上以上配置,把dhcp服务在交换机上配置,可有分担路由器的资源,同时不同vlan不同网段ip直接通过交换机来处理,上外网通过路由器出去
MSR830-WiNet系列路由器基本上网(PPPOE)命令行配置:https://www.hao0564.com/4801.html