实验描述: 本实验环境中在一台三层交换机上有三个VLAN,分别为VLAN40,VLAN20,VLAN10。
要求:VLAN40内的主机可以共享VLAN10内主机上的共享文件夹,但VLAN10内的主机不可以访问VLAN40。
sw#show run!
version 12.3
!
hostname sw
ip subnet-zero
!
!
ip cef
!
!
no ip domain lookup
!
interface FastEthernet0/0
switchport access vlan 40
no ip address
!
interface FastEthernet0/1
switchport access vlan 10
no ip address
!
interface FastEthernet0/2
switchport access vlan 20
no ip address
!
interface Vlan10
ip address 1.1.1.1 255.0.0.0
!
interface Vlan20
ip address 2.2.2.1 255.0.0.0
!
!
interface Vlan40
ip address 4.4.4.1 255.0.0.0
ip access-group vlan40tovlan10 out
!
ip http server
ip classless
!
!
!
ip access-list extended vlan40tovlan10
permit tcp 1.0.0.0 0.255.255.255 4.0.0.0 0.255.255.255 established
permit icmp 1.0.0.0 0.255.255.255 4.0.0.0 0.255.255.255 echo-reply
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
End
注明:ACL也可以用在接口VLAN10 的IN方向上,效果也一样。
说明:假如主机A在vlan10中,主机B在VLAN40,当B访问A时(通过TCP协议),在端口VLAN40的入方向和端口VLAN10的出方向上都没有应用ACL,所以流量可以通过;然后从A需要返回给B一个流量,“permit tcp 1.0.0.0 0.255.255.255 4.0.0.0 0.255.255.255 established”这条命令就是用来识别这个返回的流量的,因为是允许,所以可以通过,也就是说B可以通过TCP协议如TELNET连接A。但如果是A主动发起一个连接请求,这个流量需要从VLAN10端口进入,而在VLAN10端口应用了访问控制列表,并且没有这样的允许条目,所以这个流量不被允许通过,也就是说B不可以通过TCP协议访问A。
本文来自 280文秘网(https://www.it280.com),转载请保留网址和出处
【VLAN间的单向通信established命令】相关文章:
2025年外省高中学业水平合格性考试成绩转入江苏认定的通告公布05-07
Vb中控件的自动排列05-07
写未来的作文300字05-07
Our Mother Is the Same 我们的妈妈是一样的05-07
小学父爱的作文600字05-07
汪涵讲述小时候成长经历:鸡毛掸子的故事05-07
2023年广东梅州中考成绩查询时间及查分入口[7月7日起]05-07
关于清明节的英语作文:清明节05-07
