LinuxQuestions.org
Visit Jeremy's Blog.
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 03-12-2007, 10:24 PM   #1
keiai03
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu Edgy Elf
Posts: 6

Rep: Reputation: 0
Ip Forwarding... UBUNTU Edgy


How can i redirect this:

Wan access to Local? 121.x.x.x(public IP) the request must be forward to 10.x.x.x(local network).

Im using squid as my proxy server.
 
Old 03-13-2007, 04:47 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by keiai03
Wan access to Local? 121.x.x.x(public IP) the request must be forward to 10.x.x.x(local network).
Code:
iptables -t nat -A PREROUTING -i $WAN_IF -s 121.x.x.x -j DNAT --to-destination 10.x.x.x
Where WAN_IF is a variable that has been set to your WAN interface (such at eth0). You can just substitute that interface name for $WAN_IF in the above command if you wish.

The above command will forward all ports. If, for example, you just wish to forward port 80/tcp, you would add the options -p tcp --dport 80 . See the iptables man page for more info. There are also howtos available. You may also wish to add rules to netfilter's FORWARD chain for additional filtering.
 
Old 03-13-2007, 09:53 PM   #3
keiai03
LQ Newbie
 
Registered: Jan 2007
Distribution: Ubuntu Edgy Elf
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by blackhole54
Code:
iptables -t nat -A PREROUTING -i $WAN_IF -s 121.x.x.x -j DNAT --to-destination 10.x.x.x
Where WAN_IF is a variable that has been set to your WAN interface (such at eth0). You can just substitute that interface name for $WAN_IF in the above command if you wish.

The above command will forward all ports. If, for example, you just wish to forward port 80/tcp, you would add the options -p tcp --dport 80 . See the iptables man page for more info. There are also howtos available. You may also wish to add rules to netfilter's FORWARD chain for additional filtering.
thanks man it helps alot..
 
  


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
RP-PPPoE trouble in Ubuntu Edgy maverick_awp Linux - Newbie 1 11-26-2006 07:24 PM
set LD_ASSUME_KERNEL on ubuntu edgy vinhhv Ubuntu 0 11-05-2006 09:29 PM
LXer: Planning for Ubuntu Edgy: A mid-week report from the Ubuntu developer's conference LXer Syndicated Linux News 0 06-22-2006 11:12 PM

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

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