华为路由器配置实战汇总-nat

一、配置nat(共用一个端口)
说明:Router的出接口E0/0的IP地址为218.107.49.1*/240,接口Eth0/1.1的IP地址为192.168.95.1/24。接口Eth0/1.2的IP地址为172.20.2.1/24
内网用户通过Router的出接口做Easy IP 地址转换访问外网。
碰撞打靶实验图1 配置出接口做EASY IP组网图
pc-------route------外网
操作步骤 Router的配置石河子大学学报
interface Ethernet0/0
ip address 218.107.49.170 255.255.255.240
nat outbound 2001
#
interface Ethernet0/1
#
interface Ethernet0/1.1
ip address 192.168.95.1 255.255.255.0
vlan-type dot1q vid 95
#
interface Ethernet0/1.2
ip address 172.20.2.1 255.255.255.0
vlan-type dot1q vid 20
#
interface NULL0
#
acl number 2001
rule 0 permit source 192.168.95.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 Ethernet 0/0 218.107.49.161  preference 60
#                               
检查配置结果
在Router上执行display nat outbound命令查看出接口的Easy IP配置信息。
二苯并菲<Quidway>dis nat session
海水螺旋藻There are currently 1 NAT session:
Protocol      GlobalAddr  Port      InsideAddr  Port        DestAddr  Port
1  218.107.49.170 12288    192.168.95.1 44006        8.8.8.8 44006
VPN:  0,        status:    11,        TTL: 00:01:00,      Left: 00:00:57
<Quidway>ping -a 192.168.95.1 8.8.8.8
环球记者连线PING 8.8.8.8: 56  data bytes, press CTRL_C to break
Reply from 8.8.8.8: bytes=56 Sequence=2 ttl=48 time=11 ms
Reply from 8.8.8.8: bytes=56 Sequence=4 ttl=48 time=8 ms
Reply from 8.8.8.8: bytes=56 Sequence=5 ttl=48 time=8 ms
<Quidway>ping -a 172.20.2.1 8.8.8.8
PING 8.8.8.8: 56  data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
测试达到达到要求。
配置注意事项
配置ACL,确定对哪些网段进行NAT转换。
在出接口视图下配置NAT转换,注意转换方向。
子接口,必须配置vlan类型,否则子接口协议起不来。
二、发布内部的web服务器
#
firewall enable
#
nterface Ethernet0/0
ip address 218.107.49.170 255.255.255.240
firewall packet-filter 3001 inbound
nat outbound 2001
nat server protocol tcp global 218.107.49.170 www inside 192.168.95.2 www
#
interface Ethernet0/1
ip address 192.168.95.1 255.255.255.0
#
interface NULL0
#
acl number 2001
rule 0 permit source 192.168.95.0 0.0.0.255
#朝华mp3
acl number 3001 match-order auto
rule 0 permit tcp destination 192.168.95.2 0 destination-port eq www
#
ip route-static 0.0.0.0 0.0.0.0 Ethernet 0/0 218.107.49.161  preference 60
#
外网台机器,218.107.49.170 测试成功。
[Quidway-Ethernet0/1]dis nat all
NAT address-group information:
No address-groups have been configured
NAT outbound information:
Ethernet0/0: acl(2001) --- interface
Server in private network information:
Interface:Ethernet0/0, Protocol:6(tcp),
[global]  218.107.49.170:  80(www)  [local]    192.168.95.2:  80(www)
如果关
闭,firewall功能会怎么样呢?
好像对整个没有反应。
去掉接口下的firewall应用。?居然也没有问题。

本文发布于:2024-09-21 22:56:05,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/612160.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:配置   接口   转换   没有   达到   碰撞
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议