简单的校园网架设及多DHCP配置
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
给各位刚刚加入网络的同学们的一个实用的实验。
就是让你理解学校网络的基本架设。
至少我学校是这样的!
等于说学校有一条线进来,然后接到路由器上,路由器再分到三层交换机上,三层交换机再分VLAN到宿舍楼和办公区和教学楼,然后实现各个网段都能上网,我这里只设置上网就行了,各种策略先不做!
现在开始做
先是做ISP部份,配置好外网WEB的地址和网关!然后再进到电信的ISP路由上配置,这里只是模拟ISP,其他ISP怎么配置我也不知道,只能模拟!
在ISP路由器上做如下配置
interface fastEthernet 0/1
ip address 2.2.2.1 255.255.255.0
no shutdown
interface fastEthernet 0/0
ip address 12.1.1.1 255.255.255.252
no shutdown
ip route 0.0.0.0 0.0.0.0 12.1.1.2
ISP部分做完了
下面开始做内网,我内网就先从三层交换机做,完了以后再
做路由器
在三层核心交换机上
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 1.1.1.1
ip dhcp pool vlan15
network 192.168.15.0 255.255.255.0
default-router 192.168.15.254
dns-server 1.1.1.1
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 1.1.1.1
==========================这些是做DHCP的,就是给内网发DHCP用的interface Vlan1
ip address 10.10.10.2 255.255.255.252======这是三层交换机设置的管理地址interface Vlan10
ip address 192.168.10.254 255.255.255.0===VLAN10.就是网关的意思
interface Vlan15
ip address 192.168.15.254 255.255.255.0===同上
interface Vlan20
ip address 192.168.20.254 255.255.255.0===同上
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
===================将F0/1口设置成trunk,然后改封装成encapsulation dot1q,至于为什么,就是因为这个口要通过很多个VLAN,所以改在TRUNK。
interface FastEthernet0/10========进到F0/10口
description connect_to_sushe======描述,我这里描述”sushe”就是宿舍的意思switchport access vlan 10=========端口加到VLAN10里
switchport mode access=========设置接口为ACCESS模式
interface FastEthernet0/15
description connect_to_bangong
switchport access vlan 15
switchport mode access
interface FastEthernet0/20
description connect_to_jiaoxue
switchport access vlan 20
switchport mode access=========都是同理的,不解释!
ip route 0.0.0.0 0.0.0.0 10.10.10.1===静太路由,指向上级路由,这里不多说。
然后我们就把宿舍的PC接在三层交换机的F0/10,办公PC接在F0/15,教学PC接在F0/20口。
到这里我们的核心路由配置完了!下面配置学校出口路由
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
ip nat outside=======NAT出去
interface FastEthernet0/1
ip address 10.10.10.1 255.255.255.252
ip nat inside======== NAT进来
ip route 0.0.0.0 0.0.0.0 12.1.1.1 ===============配置一条指向外网的默认路由ip route 192.168.10.0 255.255.255.0 10.10.10.2 ===配置一条明细路由指向三层
ip route 192.168.15.0 255.255.255.0 10.10.10.2 ===配置一条明细路由指向三层
ip route 192.168.20.0 255.255.255.0 10.10.10.2===配置一条明细路由指向三层
ip access-list standard nat_pool===新建一个ACL,名字为nat_pool
permit 192.168.10.0 0.0.0.255===允许192.168.10.0的网段通过
permit 192.168.15.0 0.0.0.255===允许192.168.15.0的网段通过
permit 192.168.20.0 0.0.0.255===允许192.168.20.0的网段通过
ip nat inside source list nat_pool interface FastEthernet0/0 overload==配置NAT,不会的话自己去查一下百度吧!
所有配置完成了!开始测试。
所有PC都通了!成功了!下面把所有配置发上来。
ISP的
ISP(config-if)#do show run
Building configuration...
Current configuration : 627 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname ISP
!
!
!
enable secret 5 $1$mERr$Bok4KDfV utXOJolNq009M/ !
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 2.2.2.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 12.1.1.2
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
password cisco
login
!
!
!
end
ISP(config-if)#
学校出口路由的
outroute(config)#do show run
Building configuration...
Current configuration : 1006 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname outroute
!
!
!
enable secret 5 $1$mERr$Bok4KDfV utXOJolNq009M/ !
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.10.10.1 255.255.255.252
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list nat_pool interface FastEthernet0/0 overload ip classless
ip route 0.0.0.0 0.0.0.0 12.1.1.1
ip route 192.168.10.0 255.255.255.0 10.10.10.2
ip route 192.168.15.0 255.255.255.0 10.10.10.2
ip route 192.168.20.0 255.255.255.0 10.10.10.2
!
!
ip access-list standard nat_pool
permit 192.168.10.0 0.0.0.255
permit 192.168.15.0 0.0.0.255
permit 192.168.20.0 0.0.0.255
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
password cisco
login
!
!
end
outroute(config)#
核心交换机
SW(config-if)#do show run
Building configuration...
Current configuration : 2023 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW
!
!
!
enable secret 5 $1$mERr$Bok4KDfV utXOJolNq009M/ !
!
!
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 1.1.1.1
ip dhcp pool vlan15
network 192.168.15.0 255.255.255.0
default-router 192.168.15.254
dns-server 1.1.1.1
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 1.1.1.1
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface FastEthernet0/1 switchport trunk encapsulation dot1q switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10 description connect_to_sushe switchport access vlan 10 switchport mode access
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15 description connect_to_bangong switchport access vlan 15
switchport mode access
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
description connect_to_jiaoxue switchport access vlan 20
switchport mode access
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
ip address 10.10.10.2 255.255.255.252 !
interface Vlan10
ip address 192.168.10.254 255.255.255.0 !
interface Vlan15
ip address 192.168.15.254 255.255.255.0 !
interface Vlan20
ip address 192.168.20.254 255.255.255.0 !
ip classless
ip route 0.0.0.0 0.0.0.0 10.10.10.1
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
password cisco
login
!
!
!
end
SW(config-if)#
完了,祝大家成功!。