LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-15-2011, 11:34 PM   #31
theuser
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, 12:44 PM   #32
sberreta
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:
INTERNAL_NETWORK=10.1.1.0/24
LAN=br-lan
LANIP=10.1.1.1
SQUIDIP=200.40.180.2
SQUIDPORT=8888
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 10.1.1.1 to go through the proxy server 200.40.180.2

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

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

Rep: Reputation: Disabled
Lightbulb example

a nice server and firewall scenario to understanding the topic > digitalocean.com/community/tutorials/how-to-forward-ports-through-a-linux-gateway-with-iptables
 
  


Reply


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 11:13 PM
advantages and disadvantages of nat prerouting / postrouting? Teomari Linux - Networking 2 04-13-2007 09:28 PM
POSTROUTING or PREROUTING czezz Linux - Networking 2 01-23-2006 01:42 PM
mark set on PREROUTING stays until POSTROUTING? eantoranz Linux - Networking 3 07-26-2005 06:50 PM
POSTROUTING just stopped? ryedunn Linux - Networking 9 01-10-2005 10:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:41 AM.

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