ahuxham Posted September 17, 2008 Posted September 17, 2008 Hi Guys, Anyone know how to block external (internal) access to a port on a *nix machine. Currently running a SQUID(NTLM)>DANSGUARDIAN>SQUID(CACHE) setup and its working beautifully, only problem. Changing ports allows skipping of both S1, and DG. NTLM running on 8080, DG running on 1355, CACHE running on 1356. I can change the port to 1356 and head straight onto the interweb, how do I only allow 127.0.0.1 to access port 1356? I found this code somewhere on the interweb, however it wasn't related to the topic. iptables -t nat -D PREROUTING -s ! 127.0.0.1/24 -p tcp --dport 1356 -j DROP Not quite sure, not sure on the /24 either. Any ideas?
Geoff Posted September 17, 2008 Posted September 17, 2008 Easier way, make squid listen only on localhost. http_port localhost:1356 1
ahuxham Posted September 17, 2008 Author Posted September 17, 2008 Easier way, make squid listen only on localhost. http_port localhost:1356 Thanks Geoff, I did think of that but had tried 127.0.0.1:1356 and it still allowed a connection through, however localhost works perfectly! P.S Would the above code do the same?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now