nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Iptables and nat

This is a discussion on Iptables and nat within the Networking, Firewalls and Security forums, part of the Mastering Servers category; I have a transparent proxy server setup. If it's http stuff, it sends it to port 3128 for caching. Otherwise ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Linux answers from nixCraft.


Networking, Firewalls and Security No it's not a secret. Talk about firewalls and security issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-10-2008, 10:39 PM
Junior Member
User
 
Join Date: Mar 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bdptcob
Default Iptables and nat

I have a transparent proxy server setup. If it's http stuff, it sends it to port 3128 for caching. Otherwise it goes on to the gateway. The issue arises in that some of us have access to a different network than others and there is no way to segregate the ip's right now since they all show as coming from the proxy server's ip.

How can I configure iptables to nat any non-http packets as the originating ip?
For example:
My personal computer is 192.168.1.100. My ip has access to the 192.168.2.0 network.
The proxy server is 192.168.1.2.
The gateway is 192.168.1.1.

If attempt to ssh to 192.168.2.10, it gets denied at the gateway because it thinks the proxy is trying to access that network.

I need to send the packets from the proxy masqueraded as my computer's ip so that the gateway will allow it.
The originating ip is not always the same. We have about 200 machines.
Reply With Quote
  #2 (permalink)  
Old 11-10-2008, 02:02 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

It looks like nat is only configured for port 80 squid. To allow port 22 (ssh) and others you need to reconfigure iptables firewall.
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 11-10-2008, 03:29 AM
Junior Member
User
 
Join Date: Mar 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bdptcob
Default

Quote:
Originally Posted by rockdalinux View Post
It looks like nat is only configured for port 80 squid. To allow port 22 (ssh) and others you need to reconfigure iptables firewall.
The firewall is already configured to allow ssh. The issue is I need to forward the ssh packets on to the gateway and make it look like it's coming from the original ip, not the proxy's ip. The wrench in the system is that the originating ip can be many different ones. How can I spoof or masquerade as the original ip?
Reply With Quote
  #4 (permalink)  
Old 10-11-2008, 07:24 PM
Junior Member
User
 
Join Date: Nov 2008
OS: Fedora,CentOS,RHEL
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nishithv is on a distinguished road
Cool

Dear Friend,

for transparent squid,you need to redirect all your internal LAN 80 port traffic onto squid port 3128.It's very easy way.

Another thing,by default,sshd service is allowed in linux.So,if you have implemented any "iptables" rule, then remove it or allow your sshd port 22 from inside LAN.

Also,please send me your complete scenario,bcoz you have 2 networks i.e.192.168.1.0 & 2.0 ,So it is little bit confusing.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Iptables amsreeku Linux software 3 19-07-2008 09:29 PM
Iptables amsreeku Linux software 0 09-07-2008 07:30 PM
Iptables Help santhosheph CentOS / RHEL / Fedora 0 09-06-2008 03:36 PM
iptables help vitaminme Networking, Firewalls and Security 1 04-09-2007 02:42 AM
IPTABLES help vasanth Linux software 1 09-03-2005 09:15 AM


All times are GMT +5.5. The time now is 09:26 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38