【HCIA】学习 -- HCIA综合实验

327 阅读4分钟

image.png

开启掘金成长之旅!这是我参与「掘金日新计划 · 12 月更文挑战」的第14天,点击查看活动详情

前言

学习数通知识,考证书~ 考证书,记笔记,记笔记~

HCIA综合实验

image.png

配置要求

  • 配置所有的IP地址
  • 配置telent 要求所有设备支持远程管理,密码为admin
  • 配置trunk 交换机之间的链路均为trunk
  • 配置vlan 在交换机2和交换机3之间创建相关vlan 关联到对应的vlan接口
  • 配置MLS 通过SW1实习vlan间路由
  • 配置DHCP 是SW1可以为各个vlan主机分配地址信息
  • 配置STP 使得SW1成为vlan根桥
  • 配置ospf 企业网内部运行OSPF 1
  • 配置缺省和NAT 在R1配置默认缺省路由,SW1通过OSPF学习缺省路由
  • 配置NAT 在R1上配置PAT
  • 配饰PPP R1和R2之间封装PPP协议 使用CHAP进行双向认证 密码均为love
  • 配置OSPF R2和R3和R4之间运行OSPF2
  • 配置DNS 可以通过www.xxx.com 访问http服务,通过 www.ftp.com访问FTP服务器
  • 配置ACL,在R1上配置ACL,拒绝vlan 20 的主机通过浏览器访问HTTP服务,其他流量不受影响

先配置黄色区域

首先是交换机SW1

  • 配置dhcp
  • 配置stp优先级
  • 配置vlan 10 20 30 40
  • 由于要承担4个vlan间通信,因此配置vlanif 完成三层交换,并且针对每一个vlanif 配置dhcp server
  • 宣告ospf 宣告对应网段

SW1

sys
sys SW1

dhcp enable
vlan batch 10 20 30 40

stp priority 4096

int e0/0/1
port link-type trunk
port trunk allow vlan 10 20 30 40

int e0/0/2
port link-type trunk
port trunk allow vlan 10 20 30 40

int vlanif 10 
ip add 192.168.10.254 24
dhcp sel int
dhcp server dns 3.0.0.1

int vlanif 20 
ip add 192.168.20.254 24
dhcp sel int
dhcp server dns 3.0.0.1

int vlanif 30 
ip add 192.168.30.254 24
dhcp sel int
dhcp server dns 3.0.0.1

int vlanif 40 
ip add 192.168.40.254 24
dhcp sel int
dhcp server dns 3.0.0.1

vlan 12
int vlanif 12
int e0/0/3
port link-type access
port default vlan 12
int vlanif 12
ip address 192.168.12.2 24


ospf 1 router-id 2.2.2.2
area 0
net 192.168.12.2 0.0.0.0
net 192.168.10.254 0.0.0.0
net 192.168.20.254 0.0.0.0
net 192.168.30.254 0.0.0.0
net 192.168.40.254 0.0.0.0

SW2

  • SW2 两个连接PC的端口为accsee
  • 与交换机相连的端口配置为trunk,并且放通vlan 10 20 30 40
sys  
sys SW2  
vlan batch 10 20 30 40  
int e0/0/1  
port link-type access  
port default vlan 10  
  
int e0/0/2  
port link-type access  
port default vlan 20  
  
int e0/0/3  
port link-type trunk  
port trunk allow vlan 10 20 30 40  
  
int e0/0/3  
port link-type trunk  
port trunk allow vlan 10 20 30 40

SW3

  • SW3 两个连接PC的端口为accsee
  • 与交换机相连的端口配置为trunk,并且放通vlan 10 20 30 40
sys  
sys SW3  
vlan batch 10 20 30 40  
int e0/0/1  
port link-type access  
port default vlan 30  
  
int e0/0/2  
port link-type access  
port default vlan 40  
  
  
int e0/0/3  
port link-type trunk  
port trunk allow vlan 10 20 30 40  
  
int e0/0/4  
port link-type trunk  
port trunk allow vlan 10 20 30 40

R1

  • 宣告ospf路由
  • 在串口上使用PPP协议,并使用CHAP进行加密
  • 宣告默认路由
  • 配置acl,进行NAT
  • 配置acl 拦截vlan20的流量
sys  
sys R1  
int g0/0/0  
ip add 192.168.12.1 24  
  
ospf 1 router-id 1.1.1.1  
area 0  
net 192.168.12.2 0.0.0.0  
  
int s4/0/0  
ip add 12.0.0.1 24  
ppp chap user testuser  
ppp chap pass ci test  
  
ip route-static 0.0.0.0 0 12.0.0.2  
ospf 1  
default-route-advertise  
  
acl 2000  
rule 1 permit  
int s4/0/0  
nat outbound 2000  
  
acl 3000  
rule 1 deny tcp source 192.168.20.0 0.0.0.255 dest 4.0.0.1 0 dest eq 80  
int g0/0/0  
traffic-filter inbound acl 3000

R2

  • 宣告ospf路由
  • 在串口上使用PPP协议,并进行认证
  • 宣告默认路由
  • 配置acl,进行NAT
  • 配置acl 拦截vlan20的流量
sys  
sys R2  
int g0/0/0  
ip add 23.0.0.2 24  
  
  
int g0/0/1  
ip add 24.0.0.2 24  
  
int s4/0/0  
ip add 12.0.0.2 24  
  
ospf 1 router-id 2.2.2.2  
area 0  
net 23.0.0.2 0.0.0.0  
net 24.0.0.2 0.0.0.0  
net 12.0.0.2 0.0.0.0  
  
  
int s4/0/0  
ppp authen chap  
q  
aaa  
local-user testuser pass ci test  
local-user testuser service ppp

R3

  • 宣告ospf路由
  • 配置两个接口
sys  
sys R3  
int g0/0/0  
ip add 23.0.0.3 24  
  
  
int g0/0/1  
ip add 34.0.0.3 24  
  
int g0/0/2  
ip add 3.0.0.254 24  
  
  
ospf 1 router-id 3.3.3.3  
area 0  
net 23.0.0.3 0.0.0.0  
net 34.0.0.3 0.0.0.0  
net 3.0.0.254 0.0.0.0

R4

  • 宣告ospf路由
  • 配置两个接口
sys  
sys R4  
int g0/0/0  
ip add 24.0.0.4 24  
  
  
int g0/0/1  
ip add 34.0.0.4 24  
  
int g0/0/2  
ip add 4.0.0.254 24  
  
  
ospf 1 router-id 4.4.4.4  
area 0  
net 24.0.0.4 0.0.0.0  
net 34.0.0.4 0.0.0.0  
net 4.0.0.254 0.0.0.0

完成之后,能够实现全网通信。

image.png