路由器的配置:
1.双 adsl接入
interface FastEthernet0/1
no ip address
ip virtual-reassembly
duplex auto
speed auto
pppoe enable group global
pppoe-client dial-pool-number 1
!
interface FastEthernet0/3/0
no ip address
ip virtual-reassembly
rate-limit input access-group rate-limit 108 16000 3000 3000 conform-action transmit exceed-action drop
duplex auto
speed auto
pppoe enable group global
pppoe-client dial-pool-number 2
!
interface Dialer1
ip address negotiated
ip mtu 1492
ip nat outside
ip virtual-reassembly
encapsulation ppp
dialer pool 1
dialer idle-timeout 0
dialer-group 1
ppp authentication pap callin
ppp pap sent-username 280000036969 password 7 0302091E510B785F17
!
interface Dialer2
bandwidth 2048
ip address negotiated
ip mtu 1492
ip nat outside
ip virtual-reassembly
encapsulation ppp
ip route-cache policy
dialer pool 2
dialer idle-timeout 0
dialer-group 2
ppp authentication pap callin
ppp pap sent-username 280000047142 password 7 140D4A1A5E1D783C7D
!
2.划分vlan
a. 路由器上:
interface FastEthernet0/0
no ip address
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/0.2
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
ip policy route-map 200
!
interface FastEthernet0/0.3
encapsulation dot1Q 3
ip address 192.168.3.1 255.255.255.0
ip nat inside
ip virtual-reassembly
ip policy route-map 300
!
b.交换机上
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/5
switchport access vlan 2
!
interface FastEthernet0/6
switchport access vlan 3
!
3.用策略路由实现vlan之间的通信和adsl分流
其中的0网段链接在另一台路由器上,通过光纤上网
配置访问控制列表:
access-list 2 permit 192.168.2.0 0.0.0.255
access-list 3 permit 192.168.3.0 0.0.0.255
access-list 100 permit ip any 192.168.0.0 0.0.0.255
access-list 101 permit ip any 192.168.2.0 0.0.0.255
access-list 102 permit ip any 192.168.3.0 0.0.0.255
access-list 110 permit ip any 192.168.0.0 0.0.0.255
做策略路由:
route-map 200 permit 20
match ip address 102
set interface FastEthernet0/0.3
!
route-map 200 permit 30
match ip address 100
set ip next-hop 192.168.2.253
!
route-map 200 permit 40
match ip address 2
set interface Dialer1
!
route-map 300 permit 20
match ip address 101
set interface FastEthernet0/0.2
!
route-map 300 permit 30
match ip address 110
set ip next-hop 192.168.2.253
!
route-map 300 permit 40
match ip address 3
set interface Dialer2