Setting up Transparent Proxy on Netsweeper
Use this quick setup guide to configure the nsproxy.conf and the iptables.conf to enable transparent filtering through Netsweeper.
Configuration
Using your preferred text editor, open the NSProxy configuration file.
/usr/local/netsweeper/etc/nsproxy.conf
Next, locate the listening rules within the file, and modify as shown below.
listen http 0.0.0.0 31281
listen https 0.0.0.0 31282
Save and quit
systemctl restart nsproxyctl
If you follow the set of commands below, you will be backing up the iptables file, then copying and renaming the iptables.example to replace the iptables file.
cp /etc/sysconfig/iptables iptables.backup
cp /usr/local/netsweeper/etc/iptables.example /etc/sysconfig/iptables
Confirm by pressing (Y)
Add the below to the bottom of the new Iptables file.
*nat
-A PREROUTING -p tcp -m tcp ! -d ip.of.webadmin --dport 80 -j REDIRECT --to-port 31281
-A PREROUTING -p tcp -m tcp ! -d ip.of.webadmin --dport 443 -j REDIRECT --to-port 31282
COMMIT
Save and quit
systemctl restart iptables.
NOTE:
! -d ip.of.webadmin - As the iptables act as a firewall, you are making a rule that says NOT Domain ip.of.webadmin
Further information on this topic can also be found in our NSProxy Configuration documentation.