华为企业设备基于DHCP relay的方式

DHCP RELAY实验(华为) 拓补案例: 某个公司有三个部门,A,B,C, 企业拓补结构是, AR华为路由器+S5700核心交换机,下面接S3700汇聚交换机,汇聚交换机下面接PC 要求PC端从全局获取IP地址,方式是dhcp relay,三个地址池分别是VLAN10,20,30

请看拓补

华为企业设备基于DHCP relay的方式_第1张图片

R1配置:

[router]display current-configuration //显示用户配置
#
sysname router//命名为:router
#
undo info-center enable//关闭配置改变信息提示
#
dhcp enable//开启DHCP服务
#
ip pool vlan10//创建名为vlan10的地址池
 gateway-list 192.168.10.254//网关
 network 192.168.10.0 mask 255.255.255.0//网络地址和子网掩码
#
ip pool vlan20//创建名为vlan20的地址池
 gateway-list 192.168.20.254
 network 192.168.20.0 mask 255.255.255.0
#
ip pool vlan30
 gateway-list 192.168.30.254
 network 192.168.30.0 mask 255.255.255.0
#
#
interface Vlanif1
 ip address 192.168.1.1 255.255.255.0
 dhcp select global//dhcp获取方式为全局获取AP地址
#

#
ip route-static 192.168.10.0 255.255.255.0 192.168.1.2//静态路由,格式是,目标地址+子网掩码+下一跳地址
ip route-static 192.168.20.0 255.255.255.0 192.168.1.2
ip route-static 192.168.30.0 255.255.255.0 192.168.1.2
#

LSW1配置:

[S1]display current-configuration 
#
sysname S1
#
undo info-center enable
#
vlan batch 10 20 30//创建vlan 10 20 30
#

#
dhcp enable
#

#
interface Vlanif1
 ip address 192.168.1.2 255.255.255.0
#
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
 dhcp select relay//获取DHCP的方式是dhcp 中继
 dhcp relay server-ip 192.168.1.1
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 192.168.1.1
#
interface Vlanif30
 ip address 192.168.30.254 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 192.168.1.1
#

#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 30
#.

#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1//配置一条默认路由,当目标地址此交换机的路由表匹配上的时候,默认用这条路由转发数据包(匹配原则,1:假设目标IP地址为X,路由条目里面的IP/掩码是Y/Z,如果X和Z相与的结果等于Y,那么就会按此路由转发,当有两条以上的匹配上之后,优先选择掩码最长的转发)
#

LSW2配置

[Huawei]display current-configuration 
#
sysname Huawei
#
undo info-center enable
#
vlan batch 10 20
#
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 20
#

#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20
#

LSW3配置

[Huawei]display current-configuration 
#
sysname Huawei
#
undo info-center enable
#
vlan batch 10 30
#

#
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 30
#
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 30
#

 


 

你可能感兴趣的:(【华为华三】)