搜档网
当前位置:搜档网 › 华为(Quidway AR18-22-24)路由器配置实例

华为(Quidway AR18-22-24)路由器配置实例


环境: 因特网光纤 IP:220.166.XX.XXX 子网:255.255.255.128 网关:220.166.20.129 DNS:61.139.2.69 202.98.96.68
内网段 192.168.1.0 子网 255.255.255.0 网关:192.168.1.1(路由器IP) DNS:61.139.2.69 202.98.96.68
要求: 内网计算机都要求上Internet,主要是开放 服务器(192.168.1.2)(23000,34156,80,6800)这几个端口
具体操作如下:
进入华为路由器配置界面,怎么进入请见我收集的的文章
https://www.sodocs.net/doc/609378732.html,/trackback.php?id=32&encode=gb2312

或者: https://www.sodocs.net/doc/609378732.html,/27776/viewspace_21342.html

登录成功后,进入一个命令行的窗口,英文界面.
注: 命令帮助, 空一格后加问号 命令补全,在输入字符后紧跟问号不要空格会显示相关命令(我试了很久才出来的,用HELP无效,用 /? 也无效 只要一个问号就搞定了,呵呵)
直接键入?后出来有一样language-mode 还可以改语言不错,看帮助
支持中文方式 命令为 lan chin 缩写 只要命令不冲突 华为路由支持缩写 然后大家要查看相关命令或功能的话 在命令行输入?就行了 查看连续命令的话,比如怎么转换中文就是lan空格?号就行了 然后查看本缩写的相关命令比如就是lan?没空格
language-mode ? #查看命令帮助
#如果有很多集果 出现 --MORE--之类,用空格建换屏
language-mode chinese #切换到中文 要求输入y确认
#有中文当然更好,为什么不用,没有的时候再用E文也一样
system-view #进入系统视图
local-user root #新建或切换到一个用户 root 并且切换到 该用户 视图
password cipher ###### #给该用户设个密码
service-type telnet terminal #允许该用户通过Telnet和终端登录
level 3 #给用户指定权限级别 3为最高级别
service-type ftp #授于该用户可以通过 FTP 登录

#如果是取消该用户的FTP权限: 命令 undo service-type ftp
#开始设置访问规则(设置一个基本的ACL数值为2000号表,可以在2000-2999范围内指定)
#允许192.168.1.0 这个网段 等会在配置的时候你会知道其意思
acl number 2000
rule 0 permit source 192.168.1.0 0.0.0.255


#设置端口过滤 使得安全功能,这个大家要根据具体情况定义
#开始设置访问规则3000号表 拒绝所列协议端口或什么东东 访问
acl number 3000 match-order auto
rule 0 deny udp destination-port eq 1434
rule 1 deny udp destination-port eq 135
rule 2 deny udp destination-port eq netbios-ssn
rule 3 deny tcp destination-port eq 139
rule 4 deny tcp destination-port eq 135
rule 5 deny tcp destination-port eq 445
rule 6 deny tcp destination-port eq 593
rule 7 deny tcp destination-port eq 137
rule 8 de

ny tcp destination-port eq 138
rule 9 deny tcp destination-port eq 113
rule 10 deny tcp destination-port eq 5800
rule 11 deny tcp destination-port eq 5900
rule 12 deny udp destination-port eq 445
rule 13 deny udp destination-port eq 593
rule 14 deny udp destination-port eq netbios-ns
rule 15 deny udp destination-port eq netbios-dgm
rule 16 deny udp destination-port eq 113
rule 17 deny tcp destination-port eq 5554
rule 18 deny tcp destination-port eq 9996
rule 19 deny tcp destination-port eq 4444

#设置以太网接口 Ethernet1/0 就是哪个接光纤的哪个外网口子
interface Ethernet1/0 #进入接口视图
ip address 220.166.XX.XXX 255.255.255.128 #设置这个口的外网IP以及子网
firewall packet-filter 3000 inbound #防火墙应用过滤规则3000号规则表
nat outbound 3000 #设置nat地址转换数值为3000号规则表
nat outbound 2000 #设置nat地址转换数值为2000号规则表
#下面这些是我做的端口映射
注www,表示80端口,因为路由器如果开启WEB配置在端口上可以有冲突,所以用内部www来表示)
nat server protocol tcp global 220.166.XX.XXX www inside 192.168.1.2 www
nat server protocol tcp global 220.166.XX.XXX 34156 inside 192.168.1.2 34156
nat server protocol tcp global 220.166.XX.XXX 5781 inside 192.168.1.2 5781
nat server protocol tcp global 220.166.XX.XXX 6800 inside 192.168.1.253 6800


#如果需要重设可以使用undo命令如:
undo nat se gl 1.1.1.1 www tcpq


因interface Ethernet2/0 此接口没有用,就跳过

#设置以太网接口 Ethernet3/0 就是内网接口
interface Ethernet3/0 #进入Ethernet3/0 接口视图
ip address 192.168.1.1 255.255.255.0 #内网的路由器地址和 网段了网掩码
nat outbound 2000 #(内网口可以不设置这项,最好不要设置)

FTP server enable (FT[服务器为打开做FTP不用映射直接打开还有下面一项设置就行了)
ftp source-interface Ethernet3/0(指向FTP连接借口为以太网3/0口,内网接口)


ip route-static 0.0.0.0 0.0.0.0 220.166.20.129 preference 60 #这里是加上外网IP的网关

interface NULL0
user-interface con 0
user-interface vty 0 4
authentication-mode scheme
return

#最后 保存重启路由器
save
reboot
[/color]


以下是我在网上搜到共享给大家:

一. 摘自:https://www.sodocs.net/doc/609378732.html,/viewthread.php?tid=19620 作者:hollson

静态IP地址ADSL下华为AR 18-22-24路由器配置实例
网络要求:
所有局域网机器都受AR18-22-24控制,下分二个VLAN,
分别是VLAN1(192.168.1.0,255.255.255.0),
VLAN2(192.168.2.0,255.255.255.0).
VLAN1不能上外网且不能访问VLAN2,


VLAN2能上外网且可以访问VLAN1中的192.168.1.2.
网络环境:
静态IP地址ADSL的IP是218.xxx.xxx.xxx
外网由ADSL MODEM进来,直接到达AR18-22-24的WAN0口,局域网中的电脑都是通过AR18-22-24相连的.

配置实例是:
acl number 2001
rule 0 permit source 192.168.2.0 0.0.0.255
rule 1 deny source any
#
acl number 2002
rule 0 deny source any
#
acl number 2003
rule 0 permit source 192.168.1.2 0
rule 1 deny source 192.168.1.0 0.0.0.255
#
firewall enable
#
interface Ethernet1/0
ip address 218.xxx.xxx.xxx 255.255.255.0
nat outbound 2001
#
interface Ethernet2/0
#
interface Ethernet3/0
promiscuous
ip address 192.168.10.1 255.255.255.0
#
interface ethernet3/0.1
vlan-type dot1q vid 1
ip address 192.168.1.1 255.255.255.0
firewall packet-filter 2002 outbound
#
interface ethernet3/0.2
vlan-type dot1q vid 2
ip address 192.168.2.1 255.255.255.0
firewall packet-filter 2003
#
interface Ethernet3/1
port link-type access
port access vlan 1
#
interface Ethernet3/2
port link-type access
port access vlan 1
#
interface Ethernet3/3
port link-type access
port access vlan 1
#
interface Ethernet3/4
port link-type access
port access vlan 1
#
interface Ethernet3/5
port link-type access
port access vlan 1
#
interface Ethernet3/6
port link-type access
port access vlan 1
#
interface Ethernet3/7
port link-type access
port access vlan 1
#
interface Ethernet3/8
port link-type access
port access vlan 1
#
interface Ethernet3/9
port link-type access
port access vlan 1
#
interface Ethernet3/10
port link-type access
port access vlan 1
#
interface Ethernet3/11
port link-type access
port access vlan 1
#
interface Ethernet3/12
port link-type access
port access vlan 1
#
interface Ethernet3/13
port link-type access
port access vlan 2
#
interface Ethernet3/14
port link-type access
port access vlan 2
#
interface Ethernet3/15
port link-type access
port access vlan 2
#
interface Ethernet3/16
port link-type access
port access vlan 2
#
interface Ethernet3/17
port link-type access
port access vlan 2
#
interface Ethernet3/18
port link-type access
port access vlan 2
#
interface Ethernet3/19
port link-type access
port access vlan 2
#
interface Ethernet3/20
port link-type access
port access vlan 2
#
interface Ethernet3/21
port link-type access
port access vlan 2
#
interface Ethernet3/22
port link-type access
port access vlan 2
#
interface Ethernet3/23
port link-type access
port access vlan 2
#
interface Ethernet3/24
port link-type access
port access vlan 2
#
interface NULL0
ip route-static 0.0.0.0 0.0.0.0 218.xxx.xxx.1 preference 60
#
user-interface con 0
#
return

二.华为 AR 28-11的型号 基本适用多书华为路由 给各为不会配的参考
摘自:http:

//https://www.sodocs.net/doc/609378732.html,/BBS417926.vhtml
《[原创]华为路由基本配置 需要的进》
Login authentication
Username:ztwindows (用户)
Password:
sys (进如系统视图)
System View: return to User View with Ctrl+Z.
[quidway]dis curr (查看当前系统配置信息)
#
sysname quidway (系统名称)
#
info-center loghost 192.168.0.232(指定信息中心配置信息,这个可以不要)
#
firewall enable(开起防火墙功能)
#
dns resolve (启动动态DNS解析功能)
dns server 202.98.198.168(指定域名服务器IP地址)
dns-proxy enable(启动动态DNS解析功能)
#
radius scheme system(指定radius配置信息 创建scheme方案或者修改方案属性)
radius scheme test (test方案名)
#
domain system
#
local-user ztwindows
password cipher L_'-D*ST]8Z)9JV9LS027A!!
service-type telnet terminal
level 3
关键地方来了!
#
acl number 2000 (设置一个基本的ACL数值为2000)
rule 0 permit source 192.168.0.0 0.0.0.255 (这里配置的时候你会知道其意思)
rule 1 deny
#
acl number 3001 (设置端口过滤 使得安全功能)
rule 0 deny tcp source-port eq 3127
rule 1 deny tcp source-port eq 1025
rule 2 deny tcp source-port eq 5554
rule 3 deny tcp source-port eq 9996
rule 4 deny tcp source-port eq 1068
rule 5 deny tcp source-port eq 135
rule 6 deny udp source-port eq 135
rule 7 deny tcp source-port eq 137
rule 8 deny udp source-port eq netbios-ns
rule 9 deny tcp source-port eq 138
rule 10 deny udp source-port eq netbios-dgm
rule 11 deny tcp source-port eq 139
rule 12 deny udp source-port eq netbios-ssn
rule 13 deny tcp source-port eq 593
rule 14 deny tcp source-port eq 4444
rule 15 deny tcp source-port eq 5800
rule 16 deny tcp source-port eq 5900
rule 18 deny tcp source-port eq 8998
rule 19 deny tcp source-port eq 445
rule 20 deny udp source-port eq 445
rule 21 deny udp source-port eq 1434
rule 30 deny tcp destination-port eq 3127
rule 31 deny tcp destination-port eq 1025
rule 32 deny tcp destination-port eq 5554
rule 33 deny tcp destination-port eq 9996
rule 34 deny tcp destination-port eq 1068
rule 35 deny tcp destination-port eq 135
rule 36 deny udp destination-port eq 135
rule 37 deny tcp destination-port eq 137
rule 38 deny udp destination-port eq netbios-ns
rule 39 deny tcp destination-port eq 138
rule 40 deny udp destination-port eq netbios-dgm
rule 41 deny tcp destination-port eq 139
rule 42 deny udp destination-port eq netbios-ssn
rule 43 deny tcp destination-port eq 593
rule 44 deny tcp destination-port eq 4444
rule 45 deny tcp destination-port eq 5800
rule 46 deny tcp destination-port eq 5900
rule 48 deny tcp destination-port eq 8998
rule 49 deny tcp destination-port eq 445
rule 50 deny udp destination-port eq 445
rule 51 deny udp destination-port eq 1434
#
interface Aux0 (这个不用解释了 自己看就

知道了)
async mode flow
#
interface Ethernet0/0(设置以太网口0/0口)
speed 100(设置以太网的带宽为100M)
descrīption link_to_dianxin(以太网口标识 我设置的意思是这个口是接如点心)
tcp mss 2048(设置TCP 的MSS直最大为2048)
ip address 220.172.*.* 255.255.255.192(这里是设置这个口的外网IP以及子网)
nat outbound 2000(设置nat地址转换数值为2000)
nat server protocol tcp global 220.172.*.* 15000 inside 192.168.0.232 15000(这些是我做的端口隐射)
nat server protocol tcp global 220.172.*.* 15010 inside 192.168.0.232 15010
nat server protocol tcp global 220.172.*.* 15030 inside 192.168.0.232 15030
nat server protocol tcp global 220.172.*.* 15037 inside 192.168.0.232 15037
nat server protocol tcp global 220.172.*.* 15047 inside 192.168.0.232 15047
#
interface Ethernet0/1(上面说过接口了 这个是0/1口 看懂上面就应该看懂这里了吧)
speed 100
descrīption link_to_workgroup
tcp mss 1536
ip address 192.168.0.1 255.255.255.0
nat outbound 2000(内网口可以不设置这项)
#
interface Serial0/0(这个自己看说明就知道什么用了)
clock DTECLK1
link-protocol ppp
shutdown
ip address ppp-negotiate
#
interface Tunnel0
#
interface NULL0
#
time-range daily 08:30 to 18:30 daily
#
FTP server enable (FT[服务器为打开做FTP不用隐射直接打开还有下面一项设置就行了)
#
ftp source-interface Ethernet0/1(指向FTP连接借口为以太网0/1口)
#
undo arp check enable(使得能ARP表项检测,这个可以根据自己在加上其他参数实现)
#
ip route-static 0.0.0.0 0.0.0.0 220.172.225.129 preference 60(这里是加上外网IP的网关)
#
user-interface con 0
authentication-mode scheme
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
#
return
[quidway]
好了 大家应该看得懂了吧 对了 支持中文方式 命令为 lan chin 缩写 只要命令不冲突 华为路由支持缩写 然后大家要查看相关命令OR功能的话 在命令行输入?就行了 查看连续命令的话
比如怎么转换中文就是lan空格?号就行了 然后查看本缩写的相关命令比如就是lan?没空格


回复:
你做了端口过滤,为什么不应用到接口上?

firewall packet-filter 3001 inbound
firewall packet-filter 3001 outbound

相关主题