There is a firewall/gateway machine with eth0 Public and eth1 Private network (192.168.1.0).I would like to block all OUTPUT connections for private users (eth1)except couple of networks like: 123.123.123.0/24, 91.12.31.0/24 etc. as they are in our city network.There are a lot of questions here about iptables but I couldn't find a way to resolve this issue.It might also happen that some user, say, 192.168.1.10 would not be restricted to those networks.If I do:IPTABLES -P OUTPUT DROPIPTABLES -A OUTPUT -d 123.123.123.0/24 -s 192.168.1.51 -j ACCEPT...that would make me adding rules per user multiplied by number of networksSo is there any way to GROUP those city networks as well?
IPTABLES to block all outgoing connections except selected networks
iptables
Sounds to me that what you want is ipsets. Here is link that human beings can read. For installation, if you are on Fedora take a look at thisAnd if on Ubuntu look at this.