You got a little lost in the conversation.
I was trying to get the new chain 'WHITELIST' working but I also had issues. So I gave up and just changed everything to the system chain 'INPUT'
So if you were using a clean build and did not do any of the changes listed above you would only have to do :
1: --->>> Edit the sudoers file - /etc/sudoers - to add the line
asterisk ALL = NOPASSWD: /sbin/iptables
at the very bottom.
2: --->>> Edit the web page - /var/www/travelman/37272/index.php -
change these lines:
exec('sudo /sbin/iptables -D WHITELIST -s '.$thisip.' -j ACCEPT');
exec('sudo /sbin/iptables -A WHITELIST -s '.$thisip.' -j ACCEPT');
to these lines:
exec('sudo /sbin/iptables -D INPUT -s '.$thisip.' -j ACCEPT');
exec('sudo /sbin/iptables -A INPUT -s '.$thisip.' -j ACCEPT');
That's all that is needed to make it work . . .
I went on to say that if your only issue is that you need to restart iptables you could just add the following command listed below after the above commands. (on any set of instructions) - however I did not need to restart the iptables. I only needed the changes listed as #1 and as #2 above.
This line will restart the tables inside that index.php file --->>> exec('sudo /sbin/iptables-restart')
Hope this is clearer.
Paul
I was trying to get the new chain 'WHITELIST' working but I also had issues. So I gave up and just changed everything to the system chain 'INPUT'
So if you were using a clean build and did not do any of the changes listed above you would only have to do :
1: --->>> Edit the sudoers file - /etc/sudoers - to add the line
asterisk ALL = NOPASSWD: /sbin/iptables
at the very bottom.
2: --->>> Edit the web page - /var/www/travelman/37272/index.php -
change these lines:
exec('sudo /sbin/iptables -D WHITELIST -s '.$thisip.' -j ACCEPT');
exec('sudo /sbin/iptables -A WHITELIST -s '.$thisip.' -j ACCEPT');
to these lines:
exec('sudo /sbin/iptables -D INPUT -s '.$thisip.' -j ACCEPT');
exec('sudo /sbin/iptables -A INPUT -s '.$thisip.' -j ACCEPT');
That's all that is needed to make it work . . .
I went on to say that if your only issue is that you need to restart iptables you could just add the following command listed below after the above commands. (on any set of instructions) - however I did not need to restart the iptables. I only needed the changes listed as #1 and as #2 above.
This line will restart the tables inside that index.php file --->>> exec('sudo /sbin/iptables-restart')
Hope this is clearer.
Paul