Chinaunix

标题: cisco 3560交换机加2800路由器多VLAN共享上网配置 [打印本页]

作者: duron_1g    时间: 2008-07-24 10:08
标题: cisco 3560交换机加2800路由器多VLAN共享上网配置
经过1天的实验,完成多VLAN结合路由器经过地址换转实现共享上网问题。大家可以一起研究。为了方便交换机上启用了DHCP
网管给我了个可以上外网的地址192.168.1.199-230,网关是192.168.1.1 这个地址配置在PC可是可以上外网的。
可是分配的地址不够给需要上外网的PC,同时为了控制风险。我对需要上外网的3个部门划了3个VLAN。为了减少工作量我在3560上启用了DHCP,我现在通过1台28路由七器以及1台3560交换机
进行网络配置,共享外网,结果出了点问题。请大家指点下:
3560交换机主要配置
Building configuration...

!
no aaa new-model
vtp mode transparent
ip subnet-zero
ip routing    /*定义DHCP*/
ip dhcp excluded-address 191.168.1.1
ip dhcp excluded-address 191.168.2.1
ip dhcp excluded-address 191.168.3.1
!
ip dhcp pool 1
   network 191.168.1.0 255.255.255.0
   default-router 191.168.1.1
   dns-server 202.96.209.5 202.96.209.133
!
ip dhcp pool 2
   network 191.168.2.0 255.255.255.0
   default-router 191.168.2.1
   dns-server 202.96.209.5 202.96.209.133
!
ip dhcp pool 3
   network 191.168.3.0 255.255.255.0
   default-router 191.168.3.1
!
!
vlan 60
name office
!
vlan 61
name dzqy
!
vlan 62
name xqy
!
!
interface FastEthernet0/1        /*因为多个VLAN我设置了TRUNK模式*,是外网的jinxian
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
!
.........
!
interface FastEthernet0/23
switchport access vlan 61
switchport mode access
!
interface FastEthernet0/24
switchport access vlan 60
switchport mode access
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!         
interface Vlan1    /*与2800路由器互联地址*/
ip address 191.168.100.2 255.255.255.0
!
interface Vlan60
ip address 191.168.1.1 255.255.255.0
!
interface Vlan61
ip address 191.168.2.1 255.255.255.0
!
interface Vlan62
ip address 191.168.3.1 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 Vlan1
ip route 191.168.1.0 255.255.255.0 Vlan60
ip route 191.168.2.0 255.255.255.0 Vlan61
ip route 191.168.3.0 255.255.255.0 Vlan62
ip http server
ip http secure-server
!
!
2800路由器配置
interface FastEthernet0/0
ip address 192.168.1.199 255.255.255.0  /*可以上外网的地址*/
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 191.168.100.1 255.255.255.0/*与3560交换机互联地址*/
ip nat inside
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.1.1
ip route 191.168.1.0 255.255.255.0 191.168.100.2
ip route 191.168.2.0 255.255.255.0 191.168.100.2
ip route 191.168.3.0 255.255.255.0 191.168.100.2
!
ip http server  /*进行地址转换*/
ip nat pool adsl 192.168.1.200 192.168.1.230 netmask 255.255.255.0
ip nat inside source list 1 pool adsl overload
!
access-list 1 permit 191.168.1.0 0.0.0.255
access-list 1 permit 191.168.2.0 0.0.0.255
access-list 1 permit 191.168.3.0 0.0.0.255
!
control-plane

现在我把1台PC插在3560的24口,PC可以正常的获取地址和DNS为191.168.1.2网关为191.168.1.1
然后可以ping通路由器的2个E0口,可以实现上网
目前的问题就是头次打开一个新的网页会有点慢,打开以后就好些了,但是如果下载的话速度没有任何问题,请问有解决方法吗?
作者: duron_1g    时间: 2008-07-24 10:10
不好意思发错点交换机上没有启用trunk
interface FastEthernet0/1
作者: ssffzz1    时间: 2008-07-24 10:47
1 、你重复发帖干吗?这个是最终的正确配置吗?
2、对于初次打开慢的问题你可以考虑再2811上开DNS PROXY看能不能改善。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2