AR18宽带路由器NAT+QoS典型应用和配置

【AR18宽带路由器NAT+QoS典型应用和配置】分享给互联网从爱好者学习参考。

 应用说明
目标:在AR1830上同时启用NAT和QOS,从PC1发送的数据流定义为Gold(优先级为5),至少要保证50%的ADSL带宽;从PC2发送的数据流定义为multimedia(优先级3),至少要保证20%的ADSL带宽;网管(优先级7)要保证10%带宽,但是在网络不忙的时候,各个数据流都可以超过自己所定义的带宽。
实现:首先是在以太网入口上,对Gold,Multimedia做识别并打IP-precedence,对于网管流量,配置classifier来匹配源地址是Lo0口的数据包,然后在上行口(adsl口)先配置car来打IP-precedence,并同时配置EF队列保证优先转发。对在以太网入口打过IP-precedence的Multimedia和gold流,在上行口上做AF队列来保证带宽。 这里要注重的一点是,在出接口上要么只能配置百分比带宽,要么只能配置指定数字带宽,不能如客户要求的那样配置成既有百分比又有数据带宽(如25%/25%/16K),所以需要预先知道上行带宽,然后自己计算一下,再确认是配置成百分比还是数字带宽。
另外,ADSL接口的QoS带宽根据国际标准均为640bps。
组网图

注重事项
1、 QoS CBQ只能应用在ATM接口的PVC下,不可以直接用在ATM接口或Dialer口;
具体配置
AR18-30(PPPoE Client)配置:
dis cur
# 
sysname Router
# 
dialer-rule 1 ip permit
# 
traffic classifier gold operator and
if-match ip-precedence 5 
traffic classifier snmp operator and
if-match acl 3003 
traffic classifier multimedia operator and 
if-match ip-precedence 3 
# 
traffic behavior gold 
 queue af bandwidth pct 50
traffic behavior snmp 
 queue af bandwidth pct 10
traffic behavior multimedia
 queue af bandwidth pct 20
# 
qos policy policy1 
classifier multimedia behavior multimedia 
classifier gold behavior gold 
classifier snmp behavior snmp 
# 
interface Dialer1 
link-protocol ppp 
mtu 1450 
ip address ppp-negotiate 
dialer user test 
dialer-group 1
dialer bundle 1
nat outbound 3000 
# 
interface Ethernet1/0 
ip address 202.150.1.31 255.255.255.0 
qos car inbound acl 3001 cir 100000000 cbs 100000000 ebs 0 green remark-prec-pa
ss 5 red remark-prec-pass 5
qos car inbound acl 3002 cir 100000000 cbs 100000000 ebs 0 green remark-prec-pa
ss 3 red remark-prec-pass 3
# 
interface Atm2/0
pvc 4/33 
 map bridge Virtual-Ethernet1 
 qos reserved-bandwidth pct 100
 qos apply policy policy1 outbound
qos car outbound acl 3003 cir 16000 cbs 15000 ebs 0 green remark-prec-pass 7 re
d remark-prec-pass 7
# 
interface Virtual-Ethernet1
pppoe-client dial-bundle-number 1 
# 
interface NULL0
# 
interface LoopBack0
ip address 202.150.10.1 255.255.255.255
# 
acl number 3000
rule 0 permit ip source 202.150.1.0 0.0.0.255 
rule 1 deny ip
acl number 3001
rule 0 permit ip source 202.150.1.1 0 
acl number 3002
rule 0 permit ip source 202.150.1.2 0 
acl number 3003
rule 0 permit ip source 202.150.10.1 0
# 
ip route-static 0.0.0.0 0.0.0.0 Dialer 1 preference 60
# 
user-interface con 0
idle-timeout 0 0 
user-interface vty 0 4 
authentication-mode none 
user privilege level 3
# 
return 
AR4640(PPPoE Server)配置:
dis cur
# 
sysname AR46-40
# 
local-user test passWord simple test 
# 
ip pool 143 202.143.1.100 202.143.1.200
# 
interface Virtual-Template33
ppp authentication-mode pap scheme default
ppp accounting scheme default
ip address 202.143.1.46 255.255.255.0 
remote address pool 143 
# 
interface Aux0 
async mode flow



AR18宽带路由器NAT+QoS典型应用和配置