Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-24-2006, 10:16 PM
|
#1
|
Member
Registered: May 2005
Location: Malaysia
Posts: 33
Rep:
|
Mail Port Foward On Iptables
hello,
i,m newbie in slack. i got problem with my iptables. my linux box running as router using squid.
iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
when i put this line to my iptables i can browsing direct to internet without put the proxy on my browser n i also can access my isp email server. if i remove that line, i must put proxy setting on my browser & it's running but i can't access email from my isp. so my conclusion when i put that line it will forward all port to internet. i just want allow port 3128,8080,25 & 110 to forwards.
can any body help me how to solved that problem.
|
|
|
01-25-2006, 03:04 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
That line does not forward any ports or traffic at all. It makes the packets look like they all come from your external IP address. Your private LAN IP addresses can't be routed onto the internet so they need to look like (ie masquerade) they came from your public IP address.
Just about everyone here with a LAN/Linux/bridged modem/Internet setup with private IP addresses on their LAN will have a masquerade line (or some type of address translation) in their iptables setup.
Last edited by gilead; 01-25-2006 at 03:06 PM.
|
|
|
02-17-2006, 09:09 PM
|
#3
|
Member
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Rep:
|
Quote:
Originally Posted by pau_kacang
hello,
i,m newbie in slack. i got problem with my iptables. my linux box running as router using squid.
iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
|
this command will allow everyone to connect to anywhere and to any port. You may not want to do this.
Quote:
Originally Posted by pau_kacang
when i put this line to my iptables i can browsing direct to internet without put the proxy on my browser n i also can access my isp email server. if i remove that line, i must put proxy setting on my browser & it's running but i can't access email from my isp. so my conclusion when i put that line it will forward all port to internet. i just want allow port 3128,8080,25 & 110 to forwards.
can any body help me how to solved that problem.
|
to redirect to squid port (say 3128),
iptables -t nat -I PREROUTING -s ur_local_lan -p tcp -j REDIRECT --to-port 3128
Last edited by zamri; 02-17-2006 at 09:13 PM.
|
|
|
02-17-2006, 09:29 PM
|
#4
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Try something like:
Code:
iptables -t nat -A PREROUTING -i $EXT_DEV -p tcp --dport 25 -j DNAT --to <Mail server IP>:25
iptables -A FORWARD -i $EXT_DEV -p tcp --dport 25 -j ACCEPT
$EXT_DEV is your external facing network device.
|
|
|
All times are GMT -5. The time now is 07:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|