单臂路由的两种实现方式:


拓扑如图:

161826896.jpg

no vlan dot1q tag native 不对native vlan 加dot1q标签,当然默认交换就是这样的


1、使用R1上的物理接口的IP地址,对应于native vlan


  R1:

  interface f0/0

  speed 100

  duplex full

  ip address 192.168.1.1 255.255.255.0

  no shutdown

  interface f0/0.2

  encapsulation dot1q 2

  ip address 192.168.2.1 255.255.255.0

  no shutdown


  Switch:

  interface f0/15

  speed 100

  duplex full

  switchport trunk encapsulation dot1q

  switchport mode trunk


2、R1:

  interface f0/0

  no ip address

  no shutdown

  interface f0/0.1

  encapsulation dot1q 1 native

  ip address 192.168.1.1 255.255.255.0

  no shutdown

  interface f0/0.2

  encapsulation dot1q 2

  ip address 192.168.2.1 255.255.255.0

  no shutdown


单臂路由在工程部署中不推荐,我们实际工作环境中使用三层交换机。


174353467.jpg

调这幅图的目的是想告诉自己。这里的Switch0里并没有VLAN 2


只是开启了trunk,测试的结果我们通了。也就是说即使设备中没有


该VLAN ,只要通过trunk,我们可以将数据包送入到相应的目的端。


ACL(access control lists):是对数据层面的控制,ACE(access control entry)用来对


数据流进行分类,在物理接口或者逻辑接口进行应用。


入站inbound:接受数据的方向    出站outbound:发送数据的方向


standard acl:匹配源IP地址,不区分流量类型    1-99   1300-1999


extended acl:匹配源IP和目的IP地址,区分流量类型 100-199  2000-2699


12.3以前的版本,只能删除整个ACL,不能删除单个ACE


以后的版本,可以删除单个ACE,只要no掉那个序列号就可以了。


使用ACL的原则:


1、一个接口一个方向只能有一个ACL。


2、标准ACL需要靠近目的,因为只匹配源,所以靠近源的话,会限制这个网络的的其他应用


  扩展ACL需要靠近源


动态ACL


配置命令如下:


ip access-list extended dynamic

permit icmp host 192.168.1.2 host 192.168.1.1

dynamic test permit icmp host 192.168.1.2 host 192.168.2.2

exit

line vty 0 935

autommand access-enable host timeout 10

ratory 1

ip access-group dynamic in


自反ACL

需求就是从内网访问外网任何站点都可以,但外网访问内网不能

所以要在内网接口的in方向上,放行流量;外网接口的in方向上,拒绝掉所以流量,但


放行内网返回的流量。


ip access-list extended zifan_in

permit ip 192.168.1.0 0.0.0.255 any reflect test

ip access-list extended zifan_out

evaluate test

interface f0/0

ip access-group zifan_in in

ip access-group zifan_out in