2024年3月31日发(作者:黄翠桃)
华为路由器接入公网开局配置
移动宽带为2M, 分配给的固定IP地址:120.198.90.210 子网掩码:
255.255.255.252 网关:120.198.90.209
局域网规划地址范围为: 192.168.1.2 - 192.168.1.254 子网掩码:255.255.255.0 网
关:192.168.1.1
1.首先用串口线连接路由器的的con口,使用超级终端或者其它软件如SecureCRT,
进入路由器配置界面如下,
[hexinkeji]
[hexinkeji]dhcp server ip-pool 1(打开DHCP服务)
[hexinkeji-dhcp-pool-1] network 192.168.1.0 mask 255.255.255.0(配置IP网段)
[hexinkeji-dhcp-pool-1] gateway-list 192.168.1.1(配置网关)
[hexinkeji-dhcp-pool-1] dns-list 221.179.35.81 211.136.192.6(配置DNS)
[hexinkeji] acl number 2001(创建一个访问控制ACL 2001)
[hexinkeji-acl-basic-2001]rule 1 permit ip source 192.0.0.0 0.255.255.255 (设
置访问控制允许192.0.0.0网段通过)
[hexinkeji]interface Ethernet0/0(进去端口0/0)
[hexinkeji-Ethernet0/0]description to-waiwang(描述成接外网)
[hexinkeji-Ethernet0/0]ip address 120.198.90.210 255.255.255.252(配置外网的
静态IP地址,子网掩码)
[hexinkeji-Ethernet0/0]nat outbound 2001(做NAT地址转换,NAT转换规则根据
标准ACL来实现)
[hexinkeji]interface Ethernet0/1(进去端口0/1)
[hexinkeji-Ethernet0/1]description to-neiwang(注释成连接内网)
[hexinkeji-Ethernet0/1]ip address 192.168.1.1 255.255.255.0(配置IP地址,子
网掩码)
[hexinkeji]ip route-static 0.0.0.0 0.0.0.0 120.198.90.209(设置缺省路由,指向静
态IP网关)
< hexinkeji >save保存
1.有时候客户有特殊的要求,比如要求外网输入公网IP地址进入客户内部某台服务器,
需要做端口映射
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 www
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 pop3
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 smtp
2.设置远程外网登陆路由器:
System View: return to User View with Ctrl+Z.
[Quidway]local-user admin(用户名admin)
[Quidway-luser-admin]password simple admin(密码admin)
[Quidway-luser-admin]service-type telnet (telnet服务类型)
[Quidway-luser-admin]level 3(操作级别3)
[Quidway-luser-admin]quit
2024年3月31日发(作者:黄翠桃)
华为路由器接入公网开局配置
移动宽带为2M, 分配给的固定IP地址:120.198.90.210 子网掩码:
255.255.255.252 网关:120.198.90.209
局域网规划地址范围为: 192.168.1.2 - 192.168.1.254 子网掩码:255.255.255.0 网
关:192.168.1.1
1.首先用串口线连接路由器的的con口,使用超级终端或者其它软件如SecureCRT,
进入路由器配置界面如下,
[hexinkeji]
[hexinkeji]dhcp server ip-pool 1(打开DHCP服务)
[hexinkeji-dhcp-pool-1] network 192.168.1.0 mask 255.255.255.0(配置IP网段)
[hexinkeji-dhcp-pool-1] gateway-list 192.168.1.1(配置网关)
[hexinkeji-dhcp-pool-1] dns-list 221.179.35.81 211.136.192.6(配置DNS)
[hexinkeji] acl number 2001(创建一个访问控制ACL 2001)
[hexinkeji-acl-basic-2001]rule 1 permit ip source 192.0.0.0 0.255.255.255 (设
置访问控制允许192.0.0.0网段通过)
[hexinkeji]interface Ethernet0/0(进去端口0/0)
[hexinkeji-Ethernet0/0]description to-waiwang(描述成接外网)
[hexinkeji-Ethernet0/0]ip address 120.198.90.210 255.255.255.252(配置外网的
静态IP地址,子网掩码)
[hexinkeji-Ethernet0/0]nat outbound 2001(做NAT地址转换,NAT转换规则根据
标准ACL来实现)
[hexinkeji]interface Ethernet0/1(进去端口0/1)
[hexinkeji-Ethernet0/1]description to-neiwang(注释成连接内网)
[hexinkeji-Ethernet0/1]ip address 192.168.1.1 255.255.255.0(配置IP地址,子
网掩码)
[hexinkeji]ip route-static 0.0.0.0 0.0.0.0 120.198.90.209(设置缺省路由,指向静
态IP网关)
< hexinkeji >save保存
1.有时候客户有特殊的要求,比如要求外网输入公网IP地址进入客户内部某台服务器,
需要做端口映射
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 www
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 pop3
nat server protocol tcp global 120.198.90.210 inside 192.168.8.1 smtp
2.设置远程外网登陆路由器:
System View: return to User View with Ctrl+Z.
[Quidway]local-user admin(用户名admin)
[Quidway-luser-admin]password simple admin(密码admin)
[Quidway-luser-admin]service-type telnet (telnet服务类型)
[Quidway-luser-admin]level 3(操作级别3)
[Quidway-luser-admin]quit