Jump to content

[SOLVED] IPTables


AV1611

Recommended Posts

Help! I'm in over my head...

 

I need a set of firewall rules but I don't know how to do them.

 

I have two NIC's in a linux server.

192.168.0.111 (static)

192.168.5.1 (static, and has a DHCP server)

I figured out how to forward from the second to the first, so the server provides firewalled internet to the second network

 

Now, here is what I need to do. I use a program called dansguardian that works with squid that does content filtering, etc. If the 192.168.5.x networks does port 80 request, they get unfiltered internet. If they use proxy @ port 8080 they get filtered internet. What I am trying to do now is make a firewall rule that does this:

 

when they request a connection on 192.168.5.x port 80, the firewall forwards the request to 192.168.0.111 port 8080 and the result reply from 192.168.0.111 port 8080 is sent back to 192.168.5.x port 80.

 

Now the content filter is transparent.

 

any clue how to syntax the rules into iptables?

 

Thanks...

Link to comment
Share on other sites

Sorry, Im finding it hard to understand you setup / requirement. Which ip address is LAN and which is WAN?

 

Is this a good description of what you want to do?

 

request:

client -> lan interface(port 80) -> wan interface(port 8080) -> web

 

response:

web -> wan interface(port 8080) -> lan interface(port 80) -> client.

 

Im not sure that you get a choice about which port a web server replies to and in fact, a typical client should not be expecting a reply on post 80.

Link to comment
Share on other sites

make sure the clients internet access is filtered to block all other ports, or a client could use an anonymous proxy on a port like 23 to bypass your content filtering

 

23 is reserved for telnet, but anonymous proxies can listen to whatever port their configured for

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.