hi
# this is my firewall
iptables -t nat -F
iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 0/0 --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -p tcp -o eth0 --dport 5050 -j MASQUERADE
iptables -I INPUT -p tcp -s 0/0 -d 0/0 --dport 3128 -j DROP
iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 0/0 --dport 5050 -j REDIRECT --to-port 3128
/sbin/iptables -t nat -A POSTROUTING -s 20.20.1.1/32 -d 0/0 -j MASQUERADE
/sbin/iptables -I INPUT -p tcp -s 20.20.1.1/32 -d 0/0 --dport 3128 -j ACCEPT
# this is my night pack script
/sbin/iptables -t nat -A POSTROUTING -s 20.20.1.2/32 -d 0/0 -j MASQUERADE
/sbin/iptables -I INPUT -p tcp -s 20.20.1.2/32 -d 0/0 --dport 3128 -j ACCEPT
# this is my cron job
* 21 * * * exec /bin/night
* 09 * * * exec /bin/fwall
in 20.20.1.1 IP is UNlimited pack and 20.20.1.2 if night 9 to morng 9 pack
cron job is executing night 9 and i am getting internet of 20.20.1.2 but morng 9 it's not stoping internet access of 20.20.1.2
if i manually execute the fwall script its working fine.
pls help me
cron probl
-
- Site Admin
- Posts: 5132
- Joined: Fri May 02, 2003 10:24 am
- Location: Karachi
- Contact:
Re:
Dear venky145,
Hello,
You should flush you firewall. Night firewall should look like this.
Best Regards.
Hello,
You should flush you firewall. Night firewall should look like this.
Code: Select all
iptables -t nat -F
iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 0/0 --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -p tcp -o eth0 --dport 5050 -j MASQUERADE
iptables -I INPUT -p tcp -s 0/0 -d 0/0 --dport 3128 -j DROP
iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 0/0 --dport 5050 -j REDIRECT --to-port 3128
/sbin/iptables -t nat -A POSTROUTING -s 20.20.1.2/32 -d 0/0 -j MASQUERADE
/sbin/iptables -I INPUT -p tcp -s 20.20.1.2/32 -d 0/0 --dport 3128 -j ACCEPT
Farrukh Ahmed
cron probl
hi
20.20.1.1 ip is Unlimited internet pack (24hrs)
20.20.1.2 ip is only night 9 to morng 9 pack
if i flush and execute the night script 20.20.1.1 ip access will stoped ..
20.20.1.1 ip is Unlimited internet pack (24hrs)
20.20.1.2 ip is only night 9 to morng 9 pack
if i flush and execute the night script 20.20.1.1 ip access will stoped ..
-
- Site Admin
- Posts: 5132
- Joined: Fri May 02, 2003 10:24 am
- Location: Karachi
- Contact:
Re:
Dear venky145,
Salam,
Describe in detail what you are trying to achieve.
Best Regards.
Salam,
Describe in detail what you are trying to achieve.
Best Regards.
Farrukh Ahmed