华三交换机命令

Vlan 划分与配置

基础记了一点常用命令

int g1/0/1 #进入接口
int v 10 #进入vlan
v b 10 20 #批量创建vlan
int b 1 #创建聚合口
p link-type t #改变为turk
p t p v 10 #允许不同vlan经过
ip add 10.10.10.10 24 #配置ip地址

创建交换核心堆叠

核心堆叠是一种网络技术,它允许将多台支持堆叠特性的交换机通过专用的堆叠口连接起来,从逻辑上变成一台交换设备,作为一个整体参与数据转发。

​ 准备两台交换机

SW1配置

irf domain 10	#配置domain域
irf member 1 priority 10 #配置设备权重(大的为主)
int r t1/0/49 to t1/0/50
shutdown #端口加入之前必须先shutdowm
qu
irf-port 1/1 #irf -port 1/1 注解 前一个1代表交换机的member号,后一个代表irf-port的端口号
port group int t1/0/49
port group int t1/0/50
qu
int r t1/0/49 to t1/0/50
undo shutdown
qu
irf-port-configuration active #激活配置
save保存

SW2配置

irf domain 10	#配置domain域
irf member 1 remember 2 #重置编号后需要重启设备
qu
reboot
.......
irf member 2 priority 1 #配置设备权重(默认为1,此步可省略)
int r t2/0/49 to t2/0/50
shutdown #端口加入之前必须先shutdowm
qu
irf-port 2/2
port group int t2/0/49
port group int t2/0/50
qu
int r t2/0/49 to t2/0/50
undo shutdown
qu
irf-port-configuration active #激活配置
save保存

完成上述配置后,接线,堆叠完成

dis irf		#查看irf配置

dis irf link	#查看irf接口(多用于排错)	

IRF 心跳检测(选做)

静态路由部署与配置

原理:

路由器的核心作用是实现网络互连,数据转发,路由器工作时需要建立和更新路由表,因为路由器互联的是不同网段,因此能隔离广播,能快速转发分组数据。

路由表,简单说来就是指挥数据如何发送到目的地的表

实验准备两台路由器,两台PC

拓扑搭建完成后先使用ping测试网络是否连通

ping不通是因为路由无法正常的找到IP地址发送数据包

静态路由

[RAT-1]ip route-static 10.10.20.0 24 10.10.30.2
[RAT-2]ip route-static 10.10.10.0 24 10.10.30.1

成功ping通!

查看一下路由表 可以看到路由已经添加了

默认路由

[RAT-1]ip route-static 0.0.0.0 0 10.10.30.2
[RAT-2]ip route-static 0.0.0.0 0 10.10.30.1

华三OSPF配置

技术简介

实验拓扑

基础配置

OSPF单域配置

RTA
int g0/0
ip add 10.10.10.2 24
int s1/0
ip add 10.10.20.1 30
int s2/0
ip add 10.10.40.1 30
ospf 10
a 0
net 0.0.0.0 255.255.255.255 #默认路由
RTB
int s1/0
ip add 10.10.20.2 30
int s2/0
ip add 10.10.50.2 30
int g0/0
ip add 10.10.30.2 24
ospf 10
a 0
net 10.10.20.2 0.0.0.3
net 10.10.30.2 0.0.0.255
net 10.10.50.2 0.0.0.3
RTC
int s1/0
ip add 10.10.40.2 30
int s2/0
ip add 10.10.50.1 30
int g0/0
ip add 10.10.60.2 24
ospf 10
a 0
net 0.0.0.0 255.255.255.255

OSPF多域配置

在OSPF中,必须有一个骨干区域(通常为Area 0),所有其他区域必须直接或间接地连接到骨干区域。骨干区域负责在不同区域之间传递路由信息

#ip 地址配置同上
[RTA]
ospf 100
a 0
net 0.0.0.0 255.255.255.255

[RTB]
ospf 100
a 1
net 0.0.0.0 255.255.255.255

[RTC]
ospf 100
a 0
net 10.10.40.0 0.0.0.255
qu
a 1
net 10.10.50.0 0.0.0.255
net 10.10.60.0 0.0.0.255
save

网络访问控制

访问控制列表ACl

ACL简介

ACL(Access Control List,访问控制列表)是一系列用于识别报文流的规则的集合。这里的规则是指描述报文匹配条件的判断语句,匹配条件可以是报文的源地址、目的地址、端口号等。设备依据ACL规则识别出特定的报文,并根据预先设定的策略对其进行处理,最常见的应用就是使用ACL进行报文过滤。此外,ACL还可应用于诸如路由、安全、QoS等业务中识别报文,对这些报文的具体处理方式由应用ACL的业务模块来决定

基本ACL

基本ACL根据报文的源IP地址来制订规则,对报文进行匹配


NAPT+telent

拓扑图

内网PC

ip add 10.10.10.10 24
网关 10.10.10.2

内网服务器

int g0/0
ip add 10.10.1.10 24
ip rou 0.0.0.0 0 10.10.10.1.2
#开启tenlent 远程访问服务
telent server enable
line vty 0 4
aouthenticaition-mode scheme
user-role leave-15
qu
local-user xz
passwdorld simple 12345
service-type telent
authorization-attribute user-role leave-15

核心交换

int vlan1
ip add 10.10.10.2 24
int g1/0/2
port link-mode route
ip add 10.10.1.2 24
int g1/0/3
port like-mode route
ip add 10.10.2.1 30
ip rou 0.0.0.0 0 10.10.10.2.2

带宽路由

int g0/0
ip add 10.10.2.2 30
int s1/0
ip add 100.200.1.1 28
ip rou 0.0.0.0 0 100.200.1.2
ip rou 10.10.0.0 16 10.10.2.1
acl nember 2000
rule p s 10.10.0.0 16
nat add group 1
add 100.200.1.3 100.200.14
qu
int s1/0
nat outbound 2000
nat server protocol tcp global 100.200.3[公网] 23 inside 10.10.1.10[内网] 23

公网路由

int s1/0
ip add 100.200.1.2 28
int g0/0
ip add 20.20.20.2 24

外网PC

ip add 20.20.20.10 24
网关 20.20.20.2

此时先在内网测试telnet 服务是否失败

内网成功访问 telnet

外网PC试一下

大成功!

恭喜你学会了NAT server + telnet

ppp

#PAP认证

RTA
int s1/0
linl-protocol ppp
ppp auth-mode pap
qu
local-user xz class network
password simlpe 123456
service-type ppp
RTB

int s1/0

link-protocol ppp

ppp pap local-user xz password simple 123456

#MP

创建MP口

RTA配置
int mp 1
ip add 10.1.1.1 30
qu

int r s1/0 s2/0
ppp mp m 1
qu

local-user admin class network
passworld simple 123
service-type ppp
qu
int r s1/0 s2/0
ppp auth-mode chap
ppp chap user xz
ppp chap passwd simple 456
qu
RTB配置
int mp 1
ip add 10.1.1.2 30

local-user xz class network
passwdord simple 456
service-type ppp
qu

int r s1/0 s2/0
ppp auth-mode chap
ppp chap user admin
ppp chap password simple 123

验证配置

dis int br

ping 10.1.1.1

期末作业

PC

pc1
ip add 172.10.0.100/24
gateway 172.10.0.254

pc2
ip add 172.20.0.100/24
gateway 172.20.0.254

pc3
ip add 100.0.1.100/24
gateway 100.0.1.254

S2&S3

#S2
v 10
po g1/0/5 to g1/0/8
v 20
po g1/0/9 to g1/0/12
int g 1/0/2
port link-type trunk
port trunk p v all
stp g e
stp m rstp
stp pir 4096


#S3
v 10
po g1/0/5 to g1/0/8
v 20
po g1/0/9 to g1/0/12
int g 1/0/2
port link-type trunk
port trunk p v all
stp g e
stp rstp

S1

v 100
po g1/0/1
v 10
po g1/0/2
v 20
po g1/0/3
int v10
ip add 172.10.0.1 24
int v20
ip add 172.20.0.1
int r g1/0/2 g1/0/3
port link-type trunk
port trunk p v all

int g1/0/1
port link-mode route
ip add 10.0.0.1 30

#stp
stp g e
stp mo rstp
stp pri 0
#ospf
ospf 10
a 0
network 0.0.0.0 255.255.255.255
ip rou 0.0.0.0 0 10.0.0.2

R1

int g0/0
ip add 10.0.0.2 30
int mp 1
ip add 100.0.0.1 30
int r s1/0 s2/0
ppp mp mp1

ip rou 0.0.0.0 0 100.0.0.2

NAT#
acl nember 2000
rule p s 172.0.0.0 0.255.255.255
q
nat address group 1
add 202.0.0.1 202.0.0.6
q
int mp 1
nat oubound 2000 address group 1


R2

int mp 1
ip add 100.0.0.2 30
q
int r s1/0 s2/0
ppp mp mp1
ip rou 100.0.0.0 24 10.0.0.6
ip rou 202.0.0.0 24 100.0.0.1

#telent
telent server enable
line vty 0 4
aouthenticaition-mode scheme
user-role leave-15

local-user xz
passwdorld simple 123456
service-type telent
authorization-attribute user-role leave-15

S4

v 100
po g1/0/1
v 101
po g1/0/2
int g1/0/1
po link-mode route
ip add 10.0.0.6 30
int g1/0/2
po link-mode route
ip add 100.0.1.254
ip rou 0.0.0.0 0 10.0.0.5

禁止ping

SW1
创建高级ACL
acl ad 3000
rule deny icmp scource 172.10.0.0 0.0.0.255 destination 172.20.0.0 0.0.0.255
rule deny icmp scource 172.10.0.0 0.0.0.255 destination 172.20.0.0 0.0.0.255
int r v10 v20
packet-filter 3000 inbound

禁止telnet

SW1
acl ad 3001
rule deny tcp soure 172.10.0.100 0 destination-port eq telnet
int g1/0/1
packet-filter 3000 outbound

ospf导入默认路由

SW1
ospf 1
default-route-advertise always
qu
undo ip rou 0.0.0.0 0

chap 认证服务

主认证方R2
local-user xz class network
password simple 123
service-type ppp
qu
int r s1/0 s2/0
ppp auth-mode chap#设置认证类型

R1
int r s1/0 s2/0
ppp chap user xz
ppp chatp password simple 123