Dont apply any rules on the switch, just configure and apply the ACL on the router itself. Apply it to the VLAN 30 subinterface in the OUT direction.
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 192.168.3.1 255.255.255.0
ip access-group 1 out
!
interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address 192.168.4.1 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.25.1 255.255.255.0
duplex auto
speed auto
!
interface Serial2/0
ip address 192.168.100.1 255.255.255.0
serial restart-delay 0
!
no ip http server
no ip http secure-server
!
!
!
access-list 1 deny 192.168.2.0 0.0.0.255
access-list 1 permit any
!
end
interface Serial0/0
ip address 192.168.100.2 255.255.255.0
serial restart-delay 0
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 192.168.100.1
!
end
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 192.168.3.1 255.255.255.0
ip access-group 1 out
!
interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address 192.168.4.1 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.25.1 255.255.255.0
duplex auto
speed auto
!
interface Serial2/0
ip address 192.168.100.1 255.255.255.0
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 192.168.100.0 0.0.0.255 area 1
!
interface Serial0/0
ip address 192.168.100.2 255.255.255.0
serial restart-delay 0
!
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
!
interface FastEthernet1/0.40
encapsulation dot1Q 40
ip address 192.168.4.1 255.255.255.0
!
router ospf 1
log-adjacency-changes
network 192.168.4.0 0.0.0.255 area 3
!
router ospf 2
log-adjacency-changes
network 192.168.100.0 0.0.0.255 area 1
!
router ospf 3
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!