networking:Cisco 2921.两个子网。 192.168.1.0/24和2.0 / 24。
出于某种原因,我无法获得子网间通信。
我使用以下语句将ACL绑定到每个子网的入站接口。
在Gi0 / 0(1.0 / 24)上,我将“access-list 101 permit ip 192.168.2.0 0.0.0.255 any”应用到入站接口。
在Gi0 / 1(2.0 / 24)上,我将“access-list 102 permit ip 192.168.1.0 0.0.0.255 any”应用于入站接口。
当我这样做,DHCP停止工作,因为有时互联网,所以我删除了他们。
我在分组跟踪器中做到了这一点,它工作100%。 为什么它不能在真正的路由器上工作?
运行configuration:
Current configuration : 2608 bytes ! ! Last configuration change at 15:22:51 UTC Mon Feb 18 2013 ! NVRAM config last updated at 17:41:03 UTC Sun Feb 17 2013 ! NVRAM config last updated at 17:41:03 UTC Sun Feb 17 2013 version 15.1 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! enable secret 5 xxxxxx enable password xxxxxx ! no aaa new-model ! no ipv6 cef ip source-route ip cef ! ! ! ip dhcp excluded-address 192.168.2.1 ip dhcp excluded-address 192.168.2.1 192.168.2.99 ip dhcp excluded-address 192.168.2.1 192.168.2.50 ! ip dhcp pool DHCP_POOL network 192.168.2.0 255.255.255.0 default-router 192.168.2.1 dns-server 8.8.8.8 domain-name subnet2.local ! ! ip name-server 8.8.8.8 ip name-server 8.8.4.4 multilink bundle-name authenticated ! ! ! ! ! crypto pki token default removal timeout 0 ! ! voice-card 0 ! ! ! ! ! ! ! license udi pid CISCO2921/K9 sn FTX1703AHBN hw-module pvdm 0/0 ! ! ! ! redundancy ! ! ip ftp username xxxxxxx ip ftp password xxxxx ! ! ! ! interface Embedded-Service-Engine0/0 no ip address shutdown ! interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 ip access-group 5 out ip nat inside ip virtual-reassembly in duplex auto speed auto no mop enabled ! interface GigabitEthernet0/1 ip address 192.168.2.1 255.255.255.0 ip nat inside ip virtual-reassembly in duplex auto speed auto ! interface GigabitEthernet0/2 ip address xxxxxxxxxxx 255.255.255.248 ip nat outside ip virtual-reassembly in duplex auto speed auto ! ip forward-protocol nd ! no ip http server no ip http secure-server ! ip nat inside source list 1 interface GigabitEthernet0/2 overload ip nat inside source list 2 interface GigabitEthernet0/2 overload ip route 0.0.0.0 0.0.0.0 108.162.28.169 ip route 192.168.1.0 255.255.255.0 GigabitEthernet0/0 ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1 ! access-list 1 permit 192.168.1.0 0.0.0.255 access-list 2 permit 192.168.2.0 0.0.0.255 access-list 3 permit 192.168.2.0 0.0.0.255 access-list 3 permit 192.168.1.0 0.0.0.255 access-list 4 permit 192.168.1.0 0.0.0.255 access-list 5 permit any access-list 101 permit ip 192.168.2.0 0.0.0.255 any ! ! ! control-plane ! ! ! ! mgcp profile default ! ! ! ! ! gatekeeper shutdown ! ! ! line con 0 line aux 0 line 2 no activation-character no exec transport preferred none transport input all transport output pad telnet rlogin lapb-ta mop udptn v120 ssh stopbits 1 line vty 0 4 password ******** login transport input all ! scheduler allocate 20000 1000 end
我相信你在ACL中混合了Inbound和Outbound的概念。
如果接口GigabitEthernet0 / 0在其后面有192.168.1.0/24子网,那么为了允许该stream量继续在另一个接口上,您将在GigabitEthernet0 / 0上添加以下ACL,反之亦然。
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
access-list 102 permit ip 192.168.2.0 0.0.0.255 any
同样的事情可以通过限制stream量可以到达的地方来实现(并且会更安全)。
access-list 101 permit ip any 192.168.2.0 0.0.0.255
access-list 102 permit ip any 192.168.1.0 0.0.0.255
如果你使用上面的ACL,那么两个接口后面的networking将只能够相互通话…就是这样。
然后在GigabitEthernet0 / 0configuration中:
ip access-group 101 in
在GigabitEthernet0 / 1上:
ip access-group 102 in
入站和出站总是基于数据包将首先命中的接口。
为了更好地理解在处理ACL和入站/出站问题时,假设你是路由器和/或防火墙。
你(路由器)是否允许在你的接口Gi0 / 0上使用IP 192.168.1.10发送数据包?
是的,在这个接口上的ACL允许它;
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
要么
access-list 101 permit ip any 192.168.2.0 0.0.0.255
如果你的ACL设置在Outbound上,问题将会是这样;
你允许来自192.168.1.10的数据包离开你的接口Gi0 / 0吗?
一旦你允许这个stream量,当他们都在同一个设备上时,你不需要在目标接口上添加ACL。