LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-06-2012, 09:16 PM   #1
ryan.filler
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
HTTP and PING request forwarding


Hello all,

I have a basic network setup of a client, gateway, and server. I am currently setting up my iptables on my gateway. The basic network config looks like this:

[Client]eth1(10.0.254.1) --->eth2(10.0.254.254)[GW]eth1(192.168.0.254) ---> eth1(192.168.0.1)[Server]

The public network is between my Client and GW and the private network is between the GW and Server.

I need to set up my iptables on the GW to enable http and ping traffic from private network (192.168.0.x/24) to public network (10.0.0.x/8).

Any suggestions? Thanks in advance!
 
Old 10-07-2012, 07:52 AM   #2
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 184

Rep: Reputation: 36
I think does what you ask, but you need to enable forwarding, and use a DROP policy where
the lines below offer an exception.
ptiables -t nat -A POSTROUTING -p tcp -s 192.168.0.0/24 -d 10.0.0.0/8 --dport 80 -j MASQUERADE
iptables -t nat -A POSTROUTING -p icmp -s 192.168.0.0/24 -d 10.0.0.0/8 -j MASQUERADE

However, I think you like to make the server reachable from the client. In that case you might
need to put similar rules in the PREROUTING and use the DNAT with parameters insread of MASQUERADE
 
  


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
Log HTTP request mario.almeida Linux - Security 3 02-15-2011 10:59 AM
Ping died, scipts(with HTTP::Request) stoped.. help alex1000 Linux - Networking 5 12-02-2009 12:59 PM
http request forwarding to proxy rohit_67066 Linux - Networking 2 02-26-2009 10:47 PM
Routing http request? stiffy Linux - Server 6 02-27-2007 04:31 PM
http request mkamyar Linux - Software 5 08-30-2005 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:45 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