Solved

Simple port forwarding on Ubuntu Linux 12.04

Posted on 2013-01-17
2
1,527 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
ID: 38787349
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
ID: 38788034
It perfectly works
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

861 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

30 Experts available now in Live!

Get 1:1 Help Now