配置终端设备
配置网络设备
配置策略
验证终端互访是否满足项目要求
PC1:
192.168.1.1
255.255.255.0
192.168.1.254PC2:
192.168.2.1
255.255.255.0
192.168.2.254Server1:
192.168.3.1
255.255.255.0
192.168.3.254SW1:
undo terminal monitor
system-view
sysname SW1
vlan 10
quit
interface gi0/0/1
port link-type access
port default vlan 10
quit
interface gi0/0/2
port link-type access
port default vlan 10
quitSW2:
undo terminal monitor
system-view
sysname SW2
vlan 20
quit
interface gi0/0/1
port link-type access
port default vlan 20
quit
interface gi0/0/2
port link-type access
port default vlan 20
quitR1:undo terminal monitor
system-view
sysname R1
interface gi0/0/0
ip address 192.168.12.1 24
quitinterface gi0/0/1
ip address 192.168.1.254 24
quit
ip route-static 192.168.2.0 24 192.168.12.2 // 路由不能忘
ip route-static 192.168.3.0 24 192.168.12.2R2:
undo terminal monitor
system-view
sysname R2
interface gi0/0/0
ip address 192.168.12.2 24
quitinterface gi0/0/1
ip address 192.168.2.254 24
quitinterface gi0/0/2
ip address 192.168.3.254 24
quitip route-static 192.168.1.0 24 192.168.12.1 // 路由不能忘
R2:acl 2001rule 10 deny source 192.168.1.1 0.0.0.0//该“规则”表示的是:检查数据包的“源IP地址”(因为写了source)的4个字节(因为通配符是 0.0.0.0)数据包的源IP地址必须是 192.168.1.1 (因为规则中写了 192.168.1.1)数据匹配住以后,直接执行“拒绝动作”(因为规则中写了 deny)quit interface gi0/0/2traffic-filter outbound acl 2001 // 华为设备 ACL 与 traffic-filter 连用 默认允许所有// 对于该端口而言,要进行流量过滤(因为写了 traffic-filter)仅仅对于出方向的流量起作用(因为写了 outbound)在出方向的流量中,存在很多流量,但是仅仅关注ACL2000匹配的流量如果匹配成功的,则拒绝“出去”。 quit
添加ACL之前
添加ACL之后
验证ACL
display acl all -> 查看设备上创建的所有的ACL
display traffic-filter applied-record -> 查看ACL在接口上的调用情况
该列表中,包含了很多的“规则”。
每个规则都对应着一个动作,这个动作通常就分为两种:允许(permit) 和 拒绝(deny)
如果数据和这个规则描述的相同,称之为匹配住了该规则,此时才能执行“动作”
如果数据和这个规则描述的不同,称之为没有匹配住规则,此时不能执行“动作”
但是,每个“列表”中,通常都会存在一个 默认规则 。
上一篇:linux入门---gdb的使用
下一篇:100天精通Python(可视化篇)——第79天:matplotlib绘制不同种类炫酷折线图代码实战(网格、趋势、对比、百分比、多条折线、堆积、百分比堆积、多坐标子图、3D折线图)