DHCP与DNS与NAT配置--华为设备--ENSP模拟器--内外访问外网

实验拓扑
在这里插入图片描述
获取地址
项目连接
实验步骤
SW1
配置的接口
配置的DHCP
配置缺省路由

#
		interface GigabitEthernet0/0/1
		 port link-type access
		 port default vlan 10
		#
		interface GigabitEthernet0/0/2
		 port link-type trunk
		 port trunk allow-pass vlan 2 to 4094
		#
		DHCP配置在交换机SW2上
	 1.dhcp enable
	   2.ip pool 1
	     network 192.168.1.0 mask 255.255.255.0
	     dns-list 192.168.4.1
	     gateway-list 192.168.1.254
	     #excluded-ip-address  #可选
	     #excluded-ip-address 10.1.1.4
	     #lease day 10
	   3.vlan batch 10 20
	   4.int vlanif 10
	     ip address 192.168.1.254 255.255.255.0
	     dhcp select global
	   5.display ip pool

AR1
配置接口
配置nat
配置地址组
配置acl
进入端口使用acl
配置缺省路由
配置静态路由

	acl number 2000  
		rule 5 permit source 192.168.0.0 0.0.255.255 
		nat address-group 1 202.1.1.3 202.1.1.5
		#
		interface GigabitEthernet0/0/0
		 ip address 192.168.3.2 255.255.255.0 
		#
		interface GigabitEthernet0/0/1
			 ip address 202.1.1.1 255.255.255.0 
			 nat outbound 2000 address-group 1 
		#
		ip route 0.0.0.0 0.0.0.0 202.1.1.2
		ip route 192.168.0.0 16 192.168.3.1
SW2
	#
	interface Vlanif1
	#
	interface Vlanif10
	 ip address 192.168.1.254 255.255.255.0
	 dhcp select global
	#
	interface Vlanif20
	 ip address 192.168.2.254 255.255.255.0
	 dhcp select global
	#
	interface Vlanif30
	 ip address 192.168.3.1 255.255.255.0
	#
	interface Vlanif40
	 ip address 192.168.4.254 255.255.255.0
	#
	interface MEth0/0/1
	#
	interface GigabitEthernet0/0/1
	 port link-type trunk
	 port trunk allow-pass vlan 2 to 4094
	#
	interface GigabitEthernet0/0/2
	 port link-type access
	 port default vlan 30
	#
	interface GigabitEthernet0/0/3
	 port link-type trunk
	 port trunk allow-pass vlan 2 to 4094
	#
	interface GigabitEthernet0/0/4
	 port link-type access
	 port default vlan 40
	#
	ip route-static 0.0.0.0 0.0.0.0 192.168.3.2

SW4

interface Vlanif10
	 ip address 202.1.1.2 255.255.255.0
	#
	interface Vlanif20
	 ip address 66.66.66.254 255.0.0.0
	#
	interface MEth0/0/1
	#
	interface GigabitEthernet0/0/1
	 port link-type access
	 port default vlan 10
	#
	interface GigabitEthernet0/0/2
	 port link-type access
	 port default vlan 20
	#
	ip route-static 202.1.1.0 24 66.66.66.254

sw3

interface GigabitEthernet0/0/1
	 port link-type access
	 port default vlan 20
	#
	interface GigabitEthernet0/0/2
	 port link-type trunk
	 port trunk allow-pass vlan 2 to 4094
	#

DNS配置
在这里插入图片描述

DHCP 抓包
在这里插入图片描述

pc5 ping www.baicu.com
在这里插入图片描述

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值