第一章 ----- 小型企业园区通信网络项目设计
项目涉IP及接口设计:
设备 | 接口 | IP 地址 | 子网掩码 | 默认网关 |
R1 | Fa0/0 | 192.168.20.33 | 255.255.255.224 | 不适用 |
Fa0/1 | 参见接口配置表 | 255.255.255.0 | 不适用 | |
S0/0 | 209.165.200.241 | 255.255.255.248 | 不适用 | |
ISP | Fa0/0 | 209.165.201.17 | 255.255.255.240 | 不适用 |
Fa0/1 | 209.165.201.65 | 255.255.255.192 | 不适用 | |
S0/0 | 209.165.200.246 | 255.255.255.248 | 不适用 | |
Server1 | 网卡 | 192.168.20.62 | 255.255.255.224 | 192.168.20.33 |
HA | 网卡 | 自动获取 | 255.255.255.0 | 172.16.10.254 |
HB | 网卡 | 自动获取 | 255.255.255.0 | 172.16.20.254 |
Server2 | 网卡 | 209.165.201.30 | 255.255.255.240 | 209.165.201.17 |
HC | 网卡 | 209.165.201.126 | 255.255.255.192 | 209.165.201.65 |
交换机端口及Vlan划分:
设备名称 | 端口 | 分配 | 网络 |
S1 | Fa0/2 | VLAN 10 | 172.16.10.0 /24 |
Fa0/3 | VLAN 20 | 172.16.20.0 /24 |
路由器设备子接口配置列表:
设备名称 | 接口 | 分配 | 子接口封装协议 | IP 地址 |
R1 | Fa0/1.1 | VLAN 10 | DOT.1Q | 172.16.10.254 /24 |
Fa0/1.2 | VLAN 20 | DOT.1Q | 172.16.20.154 /24 |
拓扑图连接注意事项:
添加模块时,需要先将路由器或交换机断电。
各类模块的认识:
实训需求及解析:
(1)企业下属两个部门,各部门之间相互独立。使用vlan技术,在交换机端口模式下将端口划入相应的vlan中,实现广播域的隔离。
Switch(config)#hostname S1 # 修改交换机名称
S1(config)#vlan 10 # 创建VLAN 10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#exit
S1(config)#int f0/2 # 进入S1的f0/2端口模式
S1(config-if)#switchport access vlan 10 # 将端口划入相应d额VLAN
S1(config-if)#exit
S1(config)#int f0/3
S1(config-if)#switchport access vlan 20
(2)各部门间用户可以相互访问。也就是允许多个vlan互相通信(单臂路由)
Router(config)#hostname R1
R1(config)
R1的接口F0/上创建两个子接口
分别是F0/1.1对应的vlan10、F0/1.2对应的vlan 20
每个子接口必须封装dot1Q协议,并且标记相应的vlan id号,
dot1Q协议主要是标记vlan的id号
R1(config)#int f0/1
R1(config-if)#int f0/1.1
R1(config-if)#int f0/1.2
S1(config)#int f0/1
#配置接口为trunk口,trunk口允许多个VLAN通过。
S1(config-if)#switchport mode trunk
# 因为trunk链路封装协议有2种一个是802.1Q这个是公共协议
# 就是说所有设备都用的协议,还有一种就是CIsco私有的ISL协议。
# 因为在路由器上配单臂路由也是走VLAN信息,VLAN只能走Trunk链路。
# 而子接口是虚拟的,所有有必要对子接口进行封装协议,
# 这样双方才能了解自己用的都是那种协议
R1(config)#int f0/1
R1(config-if)#int f0/1.1
R1(config-subif)#encapsulation dot1q 10 # 协议封装
R1(config-subif)#int f0/1.2
R1(config-subif)#encapsulation dot1q 20
R1(config)#int f0/1
R1(config-if)#int f0/1.1
R1(config-subif)#ip add 172.16.10.254 255.255.255.0
R1(config-if)#int f0/1.2
R1(config-subif)#ip add 172.16.20.254 255.255.255.0
(3)终端用户动态分配IP地址
R1(config)#ip dhcp pool pool_vlan10 # 创建dhcp资源池
R1(dhcp-config)#network 172.16.10.0 255.255.255.0 设置ip字段及子网掩码
R1(dhcp-config)#exit
R1(config)#ip dhcp pool pool_vlan20
R1(dhcp-config)#network 172.16.20.0 255.255.255.0
R1(config)#ip dhcp pool pool_vlan10
R1(dhcp-config)#default-router 172.16.10.254 # 设置默认网关
R1(dhcp-config)#exit
R1(config)#ip dhcp pool pool_vlan20
R1(dhcp-config)#default-router 172.16.20.254
(4)在内网部署一台WEB服务器,对内网提供网页信息服务。将Server1直连到路由器R1的Fa0/0接口,这样在路由器R1中产生直连路由,从而保证内网的172.16.10.0/24和172.16.20.0/24两个网段对Server1的访问。
(5)企业已经成功申请公网IP地址209.165.200.240/29,需要访问INTERNET
# 默认路由的流量都是从s0/0/0这一接口出去
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0
# 使用静态NAT和动态NAT技术将内网地址转换为合法的公网地址。
# 静态NAT
R1(config)#ip nat inside source static 192.168.20.62 209.165.200.242
R1(config)#int f0/0
R1(config-if)#ip nat inside
R1(config-if)#int s0/0
R1(config-if)#ip nat outside
# 动态NAT
R1(config)#ip nat pool nat_pool 209.165.200.243 209.165.200.245 netmask 255.255.255.248
# 只有满足list 1 规则的才会进行转换
R1(config)#access-list 1 permit 172.16.0.0 0.0.255.255
R1(config)#ip nat inside source list 1 nat_pool
R1(config)#int f0/1
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#int s0/0
R1(config-if)#ip nat outside
R1(config-if)#exit
(6)为了保证网络安全,企业在与外网接口采用PPP认证的CHAP验证方式
R1(config)#username ISP password same
ISP(config)#username R1 password same
R1(config)#int s0/0
R1(config-if)#encapsulation ppp
ISP(config)#int s0/0
ISP(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
ISP(config-if)#ppp authentication chap
(7)在公网部署一台WEB服务器,对于内网用户,只允许访问外网WEB服务,禁止访问其他外部服务,但允许其访问内部WEB服务器。
ISP(config)#ip route 0.0.0.0 0.0.0.0 s0/0
# 同上述介绍
# tcp 80 端口 也就是web服务器
R1(config)#access-list 100 permit tcp 209.165.200.240 0.0.0.7 host 209.165.201.30 eq 80
R1(config)#int s0/0
R1(config-if)#ip access-group 100 out
之前都只顾这发公众号了,也忘了更新到这、
“大学生你懂得” 里面还有很多资源,总结等。