路由器+3550 dhcp+限速 全配置
这个列子已经测试过
路由器有一个公网地址。对其作nat变换
3550 主要配置 用户限速 和动态分配地址和启用三层路由功能
路由器
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname aaa
!
logging buffered 100000 debugging
enable secret 5 $1$hlqZ$99SkyO3d3x7F26tmdt5G/.
!
username aaa password 7 04510A050438
ip subnet-zero
!
!
ip name-server 209.3.6.2
ip dhcp excluded-address 192.168.188.1 192.168.188.2
!
ip dhcp pool test
network 192.168.188.0 255.255.255.0
dns-server 209.3.6.2
default-router 192.168.188.1
!
!
controller E1 1/0
!
controller E1 1/1
!
!
!
interface FastEthernet0/0
ip address 192.168.188.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 202.1.1.1 255.255.255.224
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1.1
!
interface FastEthernet0/1.2
!
ip nat inside source list 3 interface FastEthernet0/1 overload
ip classless
ip route 0.0.0.0 0.0.0.0 b.b.b.c
ip route 192.168.189.0 255.255.255.0 192.168.188.2
ip route 192.168.190.0 255.255.255.0 192.168.188.2
ip route 192.168.191.0 255.255.255.0 192.168.188.2
ip route 192.168.192.0 255.255.255.0 192.168.188.2
ip route 192.168.193.0 255.255.255.0 192.168.188.2
ip route 192.168.194.0 255.255.255.0 192.168.188.2
no ip http server
no ip pim bidir-enable
!
!
access-list 3 permit 192.168.188.0 0.0.0.255
access-list 3 permit 192.168.189.0 0.0.0.255
access-list 3 permit 192.168.194.0 0.0.0.255
access-list 3 permit 192.168.193.0 0.0.0.255
access-list 3 permit 192.168.192.0 0.0.0.255
line con 0
line aux 0
line vty 0 4
exec-timeout 5 0
password 7 0501070C2A55
login local
!
!
end
3550配置
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
service password-encryption 启用密码暗文
!
hostname xxxxxx
!
enable secret 5 $1$rM89$om4J1J8M1JK78d03GkIE8/
enable password 7 111103061911
!
username xxxxx password 7 082B4D4D0200 用于用户telnet 登陆
ip subnet-zero
ip routing
ip name-server x.x.x.x
!
////////////3550 emi dhcp 配置
ip dhcp pool YONGHU (地址池名
lease 0 0 5 (租约——)
network 192.168.194.0 255.255.255.0 [要分配的地址] [掩码]
default-router 192.168.194.1 默认网关
dns-server x.x.x.x dns服务器地址
!
////////////////对192。168。193。0 网络段用户对用户限速
mls qos
!
class-map match-all wochina 创建分类映射并进入分类映射配置模式。.
match access-group 110 定义分类通信的匹
配条件。
!
!
丢弃所匹配的数据包
policy-map test
class wochina
police 16000 8000 exceed-action drop 16000 和8000 为BIT
!
!
spanning-tree extend system-id
!
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
no ip address
!
interface FastEthernet0/2
switchport access vlan 2
no ip address
service-policy input wochina /////映射
!
interface FastEthernet0/3
switchport access vlan 3
no ip address
!
interface FastEthernet0/4 启用三层
no switchport
ip address 192.168.192.1 255.255.255.0
interface FastEthernet0/5
no ip address
!
interface FastEthernet0/6
no ip address
!
interface FastEthernet0/7
no ip address
!
interface FastEthernet0/8
no ip address
!
interface FastEthernet0/9
no ip address
!
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
no ip address
!
interface FastEthernet0/13
no ip address
!
interface FastEthernet0/14
no ip address
!
interface FastEthernet0/15
no ip address
!
interface FastEthernet0/16
no ip address
!
interface FastEthernet0/17
no ip address
!
interface FastEthernet0/18
no ip address
!
interface FastEthernet0/19
no ip address
!
interface FastEthernet0/20
no ip address
!
interface FastEthernet0/21
no ip address
!
interface FastEthernet0/22
no ip address
!
interface FastEthernet0/23
switchport access vlan 2
no ip address
!
interface FastEthernet0/24
no switchport
!
interface GigabitEthernet0/1
no ip address
!
interface GigabitEthernet0/2
no ip address
!
interface Vlan1
ip address 192.168.188.2 255.255.255.0
!
interface Vlan2
ip address 192.168.193.1 255.255.255.0
ip access-group 2 out
!
interface Vlan3
ip address 192.168.194.1 255.255.255.0
!
interface Vlan4
no ip address
!
interface Vlan6
no ip address