Solved

Simple port forwarding on Ubuntu Linux 12.04

Posted on 2013-01-17
2
1,509 Views
Last Modified: 2013-01-17
Hi all!

I want to test port forwarding and therefore I've added to a computer with two NICs this configuration:


# Port forwarding smtp
iptables -t nat -A PREROUTING -p TCP -d MYLOCALIP --dport 25 -j DNAT --to SMTPIP:25
iptables -t nat -A PREROUTING -p UDP -d MYLOCALIP --dport 25 -j DNAT --to SMTPIP:25

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT


eth0 has a public ip and the gateway to get to internet
eth1 has LAN ip

I've tried a windows xp outlook client setting its smtp to this MYLOCALIP but it won't work.

What am I doing wrong?

If it can be of any help my ISP requires username and password and this has been configured correctly on outlook.
0
Comment
Question by:ltpitt
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
ltpitt earned 0 total points
Comment Utility
Here's the solution:


iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to-destination SERVERIP:25
iptables -t nat -A PREROUTING -p tcp --dport 110 -j DNAT --to-destination SERVERIP:110
0
 
LVL 1

Author Closing Comment

by:ltpitt
Comment Utility
It perfectly works
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now