Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 07-15-2011, 10:34 PM   #31
LQ Newbie
Registered: Jun 2011
Posts: 18

Original Poster
Rep: Reputation: Disabled

I think my third point is more understandable if I say it this way:

3. every forwarded packet was DNATed at PREROUTING and SNATed at POSTROUTING
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-20-2013, 11:44 AM   #32
LQ Newbie
Registered: Dec 2013
Posts: 1

Rep: Reputation: Disabled
using a Proxy

I am using this preroute and postroute for one configuration I want to make, so to make one PC in my LAN to use an external proxy for all its traffic.

I use this:
iptables -t nat -A prerouting_rule -i $LAN -s ! $SQUIDIP -p tcp --dport 80 -j DNAT --to $SQUIDIP:$SQUIDPORT
iptables -t nat -A postrouting_rule -o $LAN -s $INTERNAL_NETWORK -d $SQUIDIP -j SNAT --to $LANIP
iptables -A forwarding_rule -s $INTERNAL_NETWORK -d $SQUIDIP -i $LAN -o $LAN -p tcp --dport $SQUIDPORT -j ACCEPT

this routes everything ok when it goes to port 80. But I want it to work with EVERY port.
the idea is to get all internet traffic originated by the ip to go through the proxy server

I wonder if someone can help me get this config working.

thanks a lot!
Old 11-28-2018, 09:48 AM   #33
LQ Newbie
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
Lightbulb example

a nice server and firewall scenario to understanding the topic >


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
postrouting all except one yawe_frek Linux - Networking 2 12-22-2007 10:13 PM
advantages and disadvantages of nat prerouting / postrouting? Teomari Linux - Networking 2 04-13-2007 08:28 PM
POSTROUTING or PREROUTING czezz Linux - Networking 2 01-23-2006 12:42 PM
mark set on PREROUTING stays until POSTROUTING? eantoranz Linux - Networking 3 07-26-2005 05:50 PM
POSTROUTING just stopped? ryedunn Linux - Networking 9 01-10-2005 09:49 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration