LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 10: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, 11:44 AM   #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, 09: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



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

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

All times are GMT -5. The time now is 09:58 PM.

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