"Guys, I am having trouble configuring a Cisco network. I have a router with three configured sub-interfaces."
interface GigabitEthernet0/1
ip address 20.0.0.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address 100.20.20.1 255.255.255.0
ip access-group PERMIT-20-TO-30 out
!
interface GigabitEthernet0/1.30
encapsulation dot1Q 30
ip address 100.30.30.1 255.255.255.0
ip access-group DENY-30-TO-20 in
!
interface GigabitEthernet0/1.40
encapsulation dot1Q 40
ip address 100.40.40.1 255.255.255.0
!
"My router is configured to distribute DHCP on each sub-interface according to its ID:"
ip dhcp excluded-address 100.20.20.1 100.20.20.10
ip dhcp excluded-address 100.30.30.1 100.30.30.10
ip dhcp excluded-address 100.40.40.1 100.40.40.10
!
ip dhcp pool SITE_A
network 100.20.20.0 255.255.255.0
default-router 20.0.0.1
dns-server 8.8.8.8
ip dhcp pool SITE_B
network 100.30.30.0 255.255.255.0
default-router 20.0.0.1
dns-server 8.8.8.8
ip dhcp pool SITE_C
network 100.40.40.0 255.255.255.0
default-router 20.0.0.1
dns-server 8.8.8.8
"I am trying to allow users on the GigabitEthernet0/1.20 sub-interface to access the GigabitEthernet0/1.30 interface without restrictions. However, I want the GigabitEthernet0/1.30 interface to not be able to access the GigabitEthernet0/1.20 interface. I am trying to do this with ACLs. I created the ACL rules:"
ip access-list extended PERMIT-20-TO-30
permit ip 100.20.20.0 0.0.0.255 100.30.30.0 0.0.0.255
permit ip any any
ip access-list extended DENY-30-TO-20
deny ip 100.30.30.0 0.0.0.255 100.20.20.0 0.0.0.255
permit ip any any
"And I applied them to the respective interfaces:"
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address 100.20.20.1 255.255.255.0
ip access-group PERMIT-20-TO-30 out
!
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address 100.20.20.1 255.255.255.0
ip access-group PERMIT-20-TO-30 out
!
"After applying the ACLs, the interfaces are not communicating at all. But I want GigabitEthernet0/1.20 to access the GigabitEthernet0/1.30 interface without restrictions. I've been struggling with this for 2 days. Is there something wrong?"
20.0.0.1
as the gateway for100.20.20.0 255.255.255.0
. You would need to use the100.20.20.1
router address as the default router for the100.20.20.0 255.255.255.0
network. A router is the host on the same network that knows how to forward traffic to other networks. You would need a router on the100.20.20.0 255.255.255.0
network to reach the20.0.0.1
router, sit it cannot be the default router for that network.