I have started constructing sites on iptables but my "simple" problem does not find the simple answer frankly expected among the multitude of examples found. I explain, in summary, my network is composed as follows
Red: 192.168.0.x
Green:
- 10.0.20.x = @ ip in dhcp dynamic
- 10.0.21.x = @ ip fixes
- Ipcop = 10.0.20.1
I would like to totally cut the access network IP addresses in dhcp and not just via http protocol (which I'm currently using squidguard of franck78) evening between 20h and 9 am.
Not at all an expert in network and much less iptables, I know, before any manipulation break if next march
Cutting access to a specific address to 20h
1 - add the cron to 20h
Code:
iptables -A INPUT -p all -s 10.0.20.159 -j DROP
iptables -A OUTPUT -p all -s 10.0.20.159 -j DROP
2 - add in the cron at 9am the same command with the option -D
Code:
iptables -D INPUT -p all -s 10.0.20.159 -j DROP
iptables -D OUTPUT -p all -s 10.0.20.159 -j DROP
if I want to completely ban access to all addresses in dhcp except my ipcop firewall, handling walk next to?
1 - add the cron at 20h
Code:
iptables -A INPUT -p all -s 10.0.20.1/8 -j DROP
iptables -A OUTPUT -p all -s 10.0.20.1/8 -j DROP
iptables -A INPUT -p all -s 10.0.20.1 -j ACCEPT
iptables -A OUTPUT -p all -s 10.0.20.1 -j ACCEPT
2 - add in the cron at 9am the same commands with the option -D
Bookmarks