LinuxQuestions.org
Review your favorite Linux distribution.
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 01-08-2008, 08:03 AM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
Newbie firewall question


Code:
iptables -t nat -A PREROUTING -i eth0 -p tcp --destination-port 80 -j DNAT --to-destination 10.5.0.1
I just want to redirect all the http trafic to any address to 10.5.0.1:80 server.

If i type www.google.com to go to 10.5.0.1

Sorry for the dumb question
 
Old 01-09-2008, 08:14 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
That'd work..
It's like a rule for using a network proxy server.

Just like all iptables rules, you need to place it in the correct order in the list.

Remember that http uses headers to name the webpage url, so the remote end needs to recognise everything it is given in a url..

Last edited by peter_robb; 01-09-2008 at 08:16 AM.
 
Old 01-09-2008, 11:21 AM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
It depends on the reasons for doing this but you may want to do the same to port 443 being https, although still not all web-servers do run on 80 or 443 but that would catch most web traffic
 
  


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
Question 1 Firewall Log Question 2 Network Monitor Soulful93 Linux - Networking 4 08-04-2004 11:05 PM
newbie ftp and firewall/ip question NonSumPisces Linux - Networking 6 07-30-2004 04:13 PM
Newbie needs help with IPtables and firewall AWyant Linux - Networking 1 09-13-2003 03:27 PM
firewall newbie question matador Linux - Security 13 08-18-2003 10:46 AM
Newbie firewall question menhilmor Linux - Security 9 07-18-2002 02:25 PM

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

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