小型企业网三层架构(基于CISCO设备)
小型企业网三层架构(基于CISCO设备,Packet Tracer7.0)
以下两个链接,是博主关于如下架构实验中具体技术进行详细分析所总结的博客,欢迎大家访问参考
企业网核心技术-网关冗余协议(HSRP、VRRP、GLBP)
企业网中基于树形拓扑防环-STP生成树协议
1.网络拓扑图
2.实验要求
1.Router0为ISP
2.三层交换与Router1连接的接口均为3层接口,右边3层交换机与PC相连的接口也为三层接口
3.内网地址为172.16.0.0/16
4.HSRP或VRRP、STP、VLAN、DTP、TRUNK、VTP、均使用
5.控制路由表条目数量
6.全网可达PC DHCP地址
3.实验分析规划
4.配置
(1).ISP
Router>enable
Router#configure terminal
Router(config)#hostname ISP
ISP(config)#no ip domain-lookup
ISP(config)#line console 0
ISP(config-line)#logging synchronous
ISP(config-line)#exec-timeout 0 0
ISP(config-line)#exit
ISP(config)#interface loopback 0
ISP(config-if)#ip address 1.1.1.1 255.255.255.0
ISP(config)#interface f0/0
ISP(config-if)#ip address 12.1.1.2 255.255.255.0
ISP(config-if)#no shutdown
(2).CORE
Router(config)#hostname CORE
CORE(config)#no ip domain-lookup
CORE(config)#line console 0
CORE(config-line)#logging synchronous
CORE(config-line)#exec-timeout 0 0
CORE(config-line)#exit
CORE(config)#interface f1/0
CORE(config-if)#ip address 12.1.1.1 255.255.255.0
CORE(config-if)#no shutdown
CORE(config-if)#exit
CORE(config)#interface f0/0
CORE(config-if)#ip address 172.16.0.1 255.255.255.0
CORE(config-if)#no shutdown
CORE(config)#interface f0/1
CORE(config-if)#ip address 172.16.1.1 255.255.255.0
CORE(config-if)#no shutdown
**EIGRP**
CORE(config)#router eigrp 100
CORE(config-router)#no auto-summary
CORE(config-router)#network 172.16.0.0
**访问外网**
CORE(config)#interface f0/0
CORE(config-if)#ip summary-address eigrp 100 0.0.0.0 0.0.0.0
CORE(config)#interface f0/1
CORE(config-if)#ip summary-address eigrp 100 0.0.0.0 0.0.0.0
CORE(config)#ip route 0.0.0.0 0.0.0.0 f1/0
CORE(config)#access-list 1 permit 172.16.0.0 0.0.255.255
CORE(config)#interface f1/0
CORE(config-if)#ip nat outside
CORE(config)#interface f0/0
CORE(config-if)#ip nat inside
CORE(config)#interface f0/1
CORE(config-if)#ip nat inside
CORE(config)#ip nat inside source list 1 interface f1/0
(3).converge1
Switch(config)#hostname CONVERGE1
CONVERGE1(config)#no ip domain-lookup
CONVERGE1(config)#line console 0
CONVERGE1(config-line)#logging synchronous
CONVERGE1(config-line)#exec-timeout 0 0
CONVERGE1(config-line)#exit
CONVERGE1(config)#interface f0/1
CONVERGE1(config-if)#no switchport
CONVERGE1(config-if)#ip address 172.16.0.2 255.255.255.0
CONVERGE1(config-if)#no shutdown
**Ether channel**
CONVERGE1(config)#interface range f0/4-5
CONVERGE1(config-if-range)#channel-group 1 mode on
CONVERGE1(config-if-range)#exit
CONVERGE1(config)#interface port-channel 1
CONVERGE1(config-if)#switchport trunk encapsulation dot1q
CONVERGE1(config-if)#switchport mode trunk
**VTP(使client同步VLAN)**
CONVERGE1(config)#vlan 2
CONVERGE1(config-vlan)#name 2
CONVERGE1(config-vlan)#exit
CONVERGE1(config)#vlan 3
CONVERGE1(config-vlan)#name 3
CONVERGE1(config-vlan)#exit
CONVERGE1(config)#vtp domain ccie
CONVERGE1(config)#vtp mode server
CONVERGE1(config)#vtp password 123
**Trunk**
CONVERGE1(config)#interface f0/2
CONVERGE1(config-if)#switchport trunk encapsulation dot1q
CONVERGE1(config-if)#switchport mode trunk
**VLAN**
CONVERGE1(config)#interface f0/3
CONVERGE1(config-if)#switchport mode access
CONVERGE1(config-if)#switchport access vlan 2
CONVERGE1(config-if)#spanning-tree portfast
CONVERGE1(config-if)#exit
CONVERGE1(config)#interface f0/6
CONVERGE1(config-if)#switchport mode access
CONVERGE1(config-if)#switchport access vlan 3
CONVERGE1(config-if)#spanning-tree portfast
CONVERGE1(config-if)#exit
CONVERGE1(config)#interface vlan 2
CONVERGE1(config-if)#ip address 172.16.2.1 255.255.255.0
CONVERGE1(config-if)#exit
CONVERGE1(config)#interface vlan 3
CONVERGE1(config-if)#ip address 172.16.3.1 255.255.255.0
CONVERGE1(config-if)#exit
**HSRP**
CONVERGE1config)#interface vlan 2
CONVERGE1(config-if)#standby 1 ip 10.1.1.1
CONVERGE1(config-if)#standby 1 preempt
CONVERGE1(config-if)#standby 1 track f0/1
CONVERGE1(config-if)#exit
CONVERGE1(config)#interface vlan 3
CONVERGE1(config-if)#standby 2 ip 11.1.1.1
CONVERGE1(config-if)#standby 2 track f0/1
CONVERGE1(config-if)#exit
**定义主备根网桥**
CONVERGE1(config)#spanning-tree vlan 2 root primary
CONVERGE1(config)#spanning-tree vlan 3 root secondary
**DHCP**
CONVERGE1(config)#ip dhcp pool 1
CONVERGE1(dhcp-config)#network 172.16.2.0 255.255.255.0
CONVERGE1(dhcp-config)#default-router 10.1.1.1
CONVERGE1(dhcp-config)#dns-server 8.8.8.8
CONVERGE1(config)#ip dhcp pool 2
CONVERGE1(dhcp-config)#network 172.16.3.0 255.255.255.0
CONVERGE1(dhcp-config)#default-router 11.1.1.1
CONVERGE1(dhcp-config)#dns-server 8.8.8.8
CONVERGE1(config)#ip dhcp excluded-address 172.16.2.1 172.16.2.2
CONVERGE1(config)#ip dhcp excluded-address 172.16.3.1 172.16.3.2
**EIGRP**
CONVERGE1(config)#ip routing
CONVERGE1(config)#router eigrp 100
CONVERGE1(config-router)#no auto-summary
CONVERGE1(config-router)#network 0.0.0.0
(4).converge2
Switch(config)#hostname CONVERGE2
CONVERGE2(config)#no ip domain-lookup
CONVERGE2(config)#line console 0
CONVERGE2(config-line)#logging synchronous
CONVERGE2(config-line)#exec-timeout 0 0
CONVERGE2(config)#interface f0/1
CONVERGE2(config-if)#no switchport
CONVERGE2(config-if)#ip address 172.16.1.2 255.255.255.0
CONVERGE2(config-if)#no shutdown
**Ether channel(DTP-自动同步Trunk)**
CONVREGE2(config)#interface range f0/4-5
CONVREGE2(config-if-range)#channel-group 1 mode on
CONVREGE2(config-if-range)#exit
**VTP(client端)**
CONVREGE2(config)#vtp domain ccie
CONVREGE2(config)#vtp mode client
CONVREGE2(config)#vtp password 123
**Trunk**
CONVREGE2(config)#interface f0/2
CONVREGE2(config-if)#switchport trunk encapsulation dot1q
CONVREGE2(config-if)#switchport mode trunk
CONVREGE2(config-if)#exit
**VLAN**
CONVREGE2(config)#interface f0/3
CONVREGE2(config-if)#switchport mode access
CONVREGE2(config-if)#switchport access vlan 2
CONVERGE2(config-if)#spanning-tree portfast
CONVERGE2(config-if)#exit
CONVREGE2(config)#interface f0/6
CONVREGE2(config-if)#switchport mode access
CONVREGE2(config-if)#switchport access vlan 3
CONVERGE2(config-if)#spanning-tree portfast
CONVERGE2(config-if)#exit
CONVERGE2(config)#interface vlan 2
CONVERGE2(config-if)#ip address 172.16.2.2 255.255.255.0
CONVERGE2(config-if)#exit
CONVERGE2(config)#interface vlan 3
CONVERGE2(config-if)#ip address 172.16.3.2 255.255.255.0
CONVERGE2(config-if)#exit
**HSRP**
CONVERGE2config)#interface vlan 2
CONVERGE2(config-if)#standby 1 ip 10.1.1.1
CONVERGE2(config-if)#standby 1 track f0/1
CONVERGE2(config-if)#exit
CONVERGE2(config)#interface vlan 3
CONVERGE2(config-if)#standby 2 ip 11.1.1.1
CONVERGE2(config-if)#standby 2 preempt
CONVERGE2(config-if)#standby 2 track f0/1
CONVERGE2(config-if)#exit
**定义主备根网桥**
CONVERGE2(config)#spanning-tree vlan 3 root primary
CONVERGE2(config)#spanning-tree vlan 2 root secondary
**DHCP**
CONVREGE2(config)#ip dhcp pool 1
CONVREGE2(dhcp-config)#network 172.16.2.0 255.255.255.0
CONVREGE2(dhcp-config)#default-router 10.1.1.1
CONVREGE2(dhcp-config)#dns-server 8.8.8.8
CONVREGE2(config)#ip dhcp pool 2
CONVREGE2(dhcp-config)#network 172.16.3.0 255.255.255.0
CONVREGE2(dhcp-config)#default-router 11.1.1.1
CONVREGE2(dhcp-config)#dns-server 8.8.8.8
CONVERGE2(config)#ip dhcp excluded-address 172.16.2.1 172.16.2.2
CONVERGE2(config)#ip dhcp excluded-address 172.16.3.1 172.16.3.2
**EIGRP**
CONVREGE2(config)#ip routing
CONVREGE2(config)#router eigrp 100
CONVREGE2(config-router)#no auto-summary
CONVREGE2(config-router)#network 0.0.0.0
(5).SW1
Switch(config)#hostname SW1
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#logging synchronous
SW1(config-line)#exec-timeout 0 0
**VTP(client端)**
SW1(config)#vtp domain ccie
SW1(config)#vtp mode client
SW1(config)#vtp password 123
**VLAN**
SW1(config)#interface f0/3
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 2
SW1(config-if)#spanning-tree portfast
SW1(config-if)#exit
SW1(config)#interface f0/4
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 3
SW1(config-if)#spanning-tree portfast
SW1(config-if)#exit
(6).SW2
Switch(config)#hostname SW2
SW2(config)#no ip domain-lookup
SW2(config)#line console 0
SW2(config-line)#logging synchronous
SW2(config-line)#exec-timeout 0 0
**VLAN**
SW2(config)#vlan 2
SW2(config-vlan)#name 2
SW2(config-vlan)#exit
SW2(config)#interface range f0/1-4
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 2
SW2(config-if-range)#spanning-tree portfast
SW2(config-if-range)#exit
(7).SW3
Switch(config)#hostname SW3
SW3(config)#no ip domain-lookup
SW3(config)#line console 0
SW3(config-line)#logging synchronous
SW3(config-line)#exec-timeout 0 0
**VLAN**
SW3(config)#vlan 3
SW3(config-vlan)#name 3
SW3(config-vlan)#exit
SW3(config)#interface range f0/1-4
SW3(config-if-range)#switchport mode access
SW3(config-if-range)#switchport access vlan 3
SW3(config-if-range)#spanning-tree portfast
SW3(config-if-range)#exit
3.实验结果
PC0
PC1
PC2
PC3
PC4
PC5
HSRP测试
访问外网
修正(2020-1-1)
之前存在错误,管理VLAN和HSRP未配置,现已经修正
整体已经修改完毕,如上述代码实现不了,可私聊我,谢谢大家支持!
只要按照上面的源码,自己敲一遍,就可以实现,我后期会详细的为大家解释三层架构中所应用到的技术及原理
网盘分享
链接: 小型企业网三层架构.pkt
提取码:ayfs
2301_80238111: 这属于双核心交换机吗?
心平气和的阿籽: 用7.0版开
m0_68402484: 我的dvwa靶场出现404
一縷清風: xss impossable难度无解吗
m0_71990539: 大佬可以发一份源文件给我嘛,谢谢