赞
踩
Packet Tracer拓扑图
Packet Tracer拓扑图
Packet Tracer拓扑图(学校)
Packet Tracer拓扑图(家庭&ISP)
a.结合网络规模/VLSM;
b.结合物理位置的核心层设备的CIDR。
网段 | 主机数 | 网络号 | 掩码 |
---|---|---|---|
校园内网 | 65536=216 | 192.168.0.0/16 | 255.255.0.0 |
服务器群 | 5<8=23 | 192.168.0.8/29 | 255.255.255.248 |
教学楼 | 16×6=96<128=27 | 192.168.0.128/25 | 255.255.255.128 |
学院办公楼 | 20×10×6=1200<2048=211 | 192.168.8.0/21 | 255.255.248.0 |
学生宿舍 | 40×6×6=1440<2048=211 | 192.168.16.0/21 | 255.255.248.0 |
城市公网 | 224 | 20.0.0.0/8 | 255.0.0.0 |
学校出校边缘路由-ISP路由 | 2<4=22 | 20.0.0.4/30 | 255.255.255.252 |
学校出校边缘路由-家庭出户路由 | 2<4=22 | 20.0.0.8/30 | 255.255.255.252 |
家庭出户路由-ISP路由 | 2<4=22 | 20.0.0.12/30 | 255.255.255.252 |
家庭网络 | 4+4+4=12<16=24 | 20.0.0.16/28 | 255.255.255.240 |
ISP网络 | 3×3+3×3×5=54<64=26 | 20.0.0.64/26 | 255.255.255.192 |
已在前面的拓扑图中加入了由AP接入的笔记本
网段/IP地址已分配 | VLAN号 | VLAN名称 | 默认网关 掩码 | 接口 |
---|---|---|---|---|
服务器群 | 2 | ServerCluster | 192.168.0.14/29 255.255.255.248 | g0/0.1 |
教学楼 | 3 | AcademicBuilding | 192.168.0.254/25 255.255.255.128 | g0/0.2 |
学院办公楼 | 4 | CollegeOfficeBuilding | 192.168.15.254/21 255.255.248.0 | g0/0.3 |
学生宿舍 | 5 | StudentDormitory | 192.168.23.254/21 255.255.248.0 | g0/0.4 |
Switch>en
Switch>enable
Switch#vlan
Switch#vlan
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vtp domain cqupt
Changing VTP domain name from NULL to cqupt
Switch(vlan)#vtp server
Device mode already VTP SERVER.
Switch>en
Switch>enable
Switch>enable
Switch#vl
Switch#vlan
Switch#vlan database
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vtp domain cqupt
Changing VTP domain name from NULL to cqupt
Switch(vlan)#vtp client
Setting device to VTP CLIENT mode.
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int range fa0/1-5 Switch(config-if-range)#sw Switch(config-if-range)#switchport m Switch(config-if-range)#switchport mode t Switch(config-if-range)#switchport mode trunk Switch(config-if-range)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up
Switch>en Switch#vl Switch#vlan Switch#vlan database % Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode. Switch(vlan)#vlan 2 name ServerCluster VLAN 2 modified: Name: ServerCluster Switch(vlan)#vlan 3 name AcademicBuilding VLAN 3 added: Name: AcademicBuilding Switch(vlan)#vlan 4 name CollegeOfficeBuilding VLAN 4 added: Name: CollegeOfficeBuilding Switch(vlan)#vlan 5 name StudentDormitory VLAN 5 added: Name: StudentDormitory
可在各交换机的VLAN数据库查看,除学校边缘路由外均以学习,学校边缘路由器需要同步配置
由于之前的汇聚交换机连在了路由的g0/2接口上,重新安排了路由的接线,换成g0/0接内部
Router>en Router#conf Router#configure t Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0 Router(config)#interface gigabitEthernet 0/0 Router(config-if)#no sh Router(config-if)#no shutdown Router(config-if)#int Router(config-if)#int g Router(config-if)#int g0/0.1 Router(config-subif)#en Router(config-subif)#encapsulation do Router(config-subif)#encapsulation dot1Q 2 Router(config-subif)#ip add Router(config-subif)#ip address 192.168.0.14 255.255.255.248 Router(config-subif)#exit Router(config)#int g0/0.2 Router(config-subif)#en Router(config-subif)#encapsulation so Router(config-subif)#encapsulation do Router(config-subif)#encapsulation dot1Q 3 Router(config-subif)#ipadd Router(config-subif)#ip add Router(config-subif)#ip address 192.168.0.254 255.255.255.128 Router(config-subif)#exit Router(config)#int g0/0.3 Router(config-subif)#en Router(config-subif)#encapsulation do Router(config-subif)#encapsulation dot1Q 4 Router(config-subif)#ip add Router(config-subif)#ip address 192.168.15.254 255.255.248.0 Router(config-subif)#exit Router(config)#int g0/0.4 Router(config-subif)#en Router(config-subif)#encapsulation do Router(config-subif)#encapsulation dot1Q 5 Router(config-subif)#ip add Router(config-subif)#ip address 192.168.23.254 255.255.248.0 Router(config-subif)#exit Router(config)#exit Router# %SYS-5-CONFIG_I: Configured from console by console exit
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/1 Switch(config-if)#sw Switch(config-if)#switchport mo Switch(config-if)#switchport mode a Switch(config-if)#switchport mode access Switch(config-if)#sw Switch(config-if)#switchport a Switch(config-if)#switchport access vl Switch(config-if)#switchport access vlan 2 Switch(config-if)#exit Switch(config)#int ran Switch(config)#int range f0/3-10 Switch(config-if-range)#sw Switch(config-if-range)#switchport m Switch(config-if-range)#switchport mode a Switch(config-if-range)#switchport mode access Switch(config-if-range)#sw Switch(config-if-range)#switchport a Switch(config-if-range)#switchport access vl Switch(config-if-range)#switchport access vlan % Incomplete command. Switch(config-if-range)#switchport access vlan 2 Switch(config-if-range)#exit Switch(config)#
其他交换机配置代码类似
Router>en Router>enable Router#conf Router#configure t Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/1 Router(config-if)#ip ad Router(config-if)#ip address 20.0.0.5 255.255.255.252 Router(config-if)#no sh Router(config-if)#no shutdown Router(config-if)#exit Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/2 Router(config-if)#ip ad Router(config-if)#ip address 20.0.0.10 255.255.255.252 Router(config-if)#no sh Router(config-if)#no shutdown Router(config-if)#exit Router(config)#exit Router# %SYS-5-CONFIG_I: Configured from console by console exit
Packet Tracer拓扑图
IP以之前的分配为准
Packet Tracer拓扑图
主机名称 | IP | 掩码 | 网关 |
---|---|---|---|
无线检测笔记本 | 192.168.0.9/29 | 255.255.255.248 | 192.168.0.14/29 |
教室电脑 | 192.168.0.129/25 | 255.255.255.128 | 192.168.0.254/25 |
老师办公室电脑 | 192.168.8.1/21 | 255.255.248.0 | 192.168.15.254/21 |
230台式 | 192.168.16.1/21 | 255.255.248.0 | 192.168.23.254/21 |
230笔记本 | 192.168.16.2/21 | 255.255.248.0 | 192.168.23.254/21 |
家庭笔记本 | 20.0.0.17/28 | 255.255.255.240 | 20.0.0.30/28 |
家庭计算机 | 20.0.0.18/28 | 255.255.255.240 | 20.0.0.30/28 |
ISP管理中心主机 | 20.0.0.65/26 | 255.255.255.192 | 20.0.0.126/26 |
Router>en Router>enable Router#conf Router#configure t Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ro Router(config)#router os Router(config)#router ospf 1 Router(config-router)#net Router(config-router)#network 192.168.0.8 0.0.0.7 area 0 Router(config-router)#net Router(config-router)#network 192.168.0.128 0.0.0.127 area 0 Router(config-router)#net Router(config-router)#network 192.168.8.0 0.0.7.255 area 0 Router(config-router)#net Router(config-router)#network 192.168.16.0 0.0.7.255 area 0 Router(config-router)#net Router(config-router)#network 20.0.0.4 0.0.0.3 area 0 Router(config-router)#ne Router(config-router)#net Router(config-router)#network 20.0.0.8 0.0.0.3 area 0 Router(config-router)#end Router# %SYS-5-CONFIG_I: Configured from console by console Router#exit
Packet Tracer拓扑图
服务器名称 | 学校内网DHCP | ISP服务器中心DHCP |
---|---|---|
IP | 192.168.0.10 | 20.0.0.125 |
掩码 | 255.255.255.248 | 255.255.255.192 |
网关 | 192.168.0.14 | 20.0.0.126 |
Router>en Router>en Router>enable Router#conf Router#configure t Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int g0/0.1 Router(config-subif)#ip h Router(config-subif)#ip he Router(config-subif)#ip hel Router(config-subif)#ip helper Router(config-subif)#ip helper-address 192.168.0.10 Router(config-subif)#exit Router(config)#int g0/0.2 Router(config-subif)#ip hel Router(config-subif)#ip help Router(config-subif)#ip helper-address 192.168.0.10 Router(config-subif)#exit Router(config)#in Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.3 Router(config-subif)#ip help Router(config-subif)#ip helper-address 192.168.0.10 Router(config-subif)#exit Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.4 Router(config-subif)#ip help Router(config-subif)#ip helper-address 192.168.0.10 Router(config-subif)#exit Router(config)#exit Router# %SYS-5-CONFIG_I: Configured from console by console exit
配置完成后可将之前的主机IP配置从静态切换成DHCP(其中服务器的IP保持静态,而笔记本必须要使用DHCP,否则就会出现更换WiFi导致网关不对应而无法通信的现象)
网段 | 学校公网 |
---|---|
地址数 | 256=28 |
IP池 | 20.0.1.0/24 |
IP池掩码 | 255.255.255.0 |
access-list(ACL) | 1 |
ACL范围 | 192.168.0.0/16 0.0.255.255 |
Router>en Router>enable Router#conf Router#configure t Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip n Router(config)#ip na Router(config)#ip nat Router(config)#ip nat pool school 20.0.1.1 20.0.1.254 net Router(config)#ip nat pool school 20.0.1.1 20.0.1.254 netmask 255.255.255.0 Router(config)#acc Router(config)#access-list 1 per Router(config)#access-list 1 permit 192.168.0.0 0.0.255.255 Router(config)#ip nat ins Router(config)#ip nat inside so Router(config)#ip nat inside source li Router(config)#ip nat inside source list 1 Router(config)#ip nat inside source list 1 po Router(config)#ip nat inside source list 1 pool school Router(config)#int Router(config)#interface ran Router(config)#interface range g Router(config)#interface range gigabitEthernet 0/1-2 Router(config)#interface range gigabitEthernet 0/1-2 Router(config-if-range)#ip mat out Router(config-if-range)#ip mat outs Router(config-if-range)#ip mat outside Router(config-if-range)#ip mat outside ^ % Invalid input detected at '^' marker. Router(config-if-range)#ip nat ou Router(config-if-range)#ip nat outside Router(config-if-range)#exit Router(config)#int Router(config)#interface g Router(config)#interface ra Router(config)#interface range g Router(config)#interface range gigabitEthernet 0/0.1-0.4 ^ % Invalid input detected at '^' marker. Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.1 Router(config-subif)#ip nat in Router(config-subif)#ip nat inside Router(config-subif)#exit Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.2 Router(config-subif)#ip nat in Router(config-subif)#ip nat inside Router(config-subif)#exit Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.3 Router(config-subif)#ip nat in Router(config-subif)#ip nat inside Router(config-subif)#exit Router(config)#int Router(config)#interface g Router(config)#interface gigabitEthernet 0/0.4 Router(config-subif)#ip nat in Router(config-subif)#ip nat inside Router(config-subif)#exit Router(config)#exit Router# %SYS-5-CONFIG_I: Configured from console by console exit
Packet Tracer拓扑图
配置项包括学校出校边缘路由到学校出校公网路由之间的两个端口IP,学校出校边缘路由的NAT转换IP池不能包括这两个IP,两个路由的OSPF协议中加入学校公网条目
学校内部主机ping外部时NAT生效且由于高速缓存可以ping通
Packet Tracer拓扑图
同步配置几个服务器的IP等条目
名称 | 学校内网DNS服务器 | 学校内网Web服务器 | ISP DNS服务器 | ISP Web服务器 |
---|---|---|---|---|
IP | 192.168.0.11 | 192.168.0.12 | 20.0.0.124 | 20.0.0.123 |
掩码 | 255.255.255.248 | 255.255.255.248 | 255.255.255.192 | 255.255.255.192 |
网关 | 192.168.0.14 | 192.168.0.14 | 20.0.0.126 | 20.0.0.126 |
DNS | 192.168.0.11 | 192.168.0.11 | 20.0.0.124 | 20.0.0.124 |
完成后还需要将DHCP服务器的每个IP池添加上DNS服务器IP
&:本来想做DNS迭代查询的,但是怎么也没弄明白,有会的小伙伴留个链接
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。