LinuxQuestions.org
Help answer threads with 0 replies.
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 07-10-2013, 10:21 AM   #1
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Rep: Reputation: 10
Question Need my Exchange to use diff IP for outgoing


I am using Ubuntu 9.10 with Arnos IP tables firewall.

I'm unable to find any documentation on /etc/arnos~/firewall.conf
There is a NAT_FORWARD_IP section, but I dunno how to configure it.

So I must use iptables manually.

Code:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -s 192.168.88.9 -j SNAT --to-source 1.2.3.4
The above code doesn't apply when I restart arnos.

The below code works - everything is using the new external IP. However, that is the problem - I need just Exchange using that IP so these stupid tenants with viruses don't blacklist my ******* server.
Code:
iptables -t nat -A POSTROUTING -p tcp -j SNAT --to-source 1.2.3.4
So why can't I just add an -s switch and specify my Exchange server like the first code?

THANKS!!!!
 
Old 07-10-2013, 12:53 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by notsure View Post
I am using Ubuntu 9.10 with Arnos IP tables firewall.

I'm unable to find any documentation on /etc/arnos~/firewall.conf
There is a NAT_FORWARD_IP section, but I dunno how to configure it.
Then why use it?

From what I see, Arno's iptables firewall is just a script. You'll either have to find out how it works, or find another solution.

Quote:
Originally Posted by notsure View Post
So I must use iptables manually.

Code:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -s 192.168.88.9 -j SNAT --to-source 1.2.3.4
The above code doesn't apply when I restart arnos.
Probably because the script flushes all tables and chains before adding its own rules. Have you tried adding that command to the end of the existing script? You'll have to add it to a script that runs at startup anyway, as no setting will survive a reboot otherwise.

By the way, isn't the port number wrong? TCP port 80 is web traffic, while SMTP uses TCP port 25.

Quote:
Originally Posted by notsure View Post
Code:
iptables -t nat -A POSTROUTING -p tcp -j SNAT --to-source 1.2.3.4
So why can't I just add an -s switch and specify my Exchange server like the first code?
I don't know, why can't you? Adding -s exchange_server_ip right after "POSTROUTING" in the rule above should do the trick. Unless it's overridden by an earlier rule added by this "Arno's" script. Have you tries inserting the rule at the top of the chain with "-I" instead of "-A"?
 
Old 07-10-2013, 12:59 PM   #3
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
Thanks for the response!

I'm not reinventing the wheel - arnos has been inplace here for years.

Yes, I was just testing port 80 because it was easy to go to whatismyip.com.

I don't think the rule is being overwritten - I'm thinking I just have the syntax wrong or something because I can successfully route EVERYONE to the new IP.

I didn't try the -s switch right after POSTROUTING so I'll try that soon (users are complaining about internet dropping so I'm gonna wait a bit).


I'll post back in an hour or so.

Thanks again!
 
Old 07-10-2013, 05:32 PM   #4
notsure
Member
 
Registered: Jun 2012
Location: Detroit
Distribution: Arch x86_64
Posts: 112

Original Poster
Rep: Reputation: 10
Apparently, I had it on the first try...

This works:

Code:
iptables -t nat -A POSTROUTING -s 192.168.88.9 -p tcp -j SNAT --to-source 1.2.3.4
Doesn't work without "-p tcp".

Also, whatismyip.com doesn't show the alternate public IP. I connected via RDP and SSH and it all checked out with the new public IP.
And more importantly, my emails are going out through the IP that isn't blacklisted! I also found the virus computer. Some tenants use POP3 with port 25 so when I reviewed my packet log on the router it was hard to determine what was bad 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
Seeking Exchange client for Slackware with Exchange Calender support... the86d Slackware 4 09-09-2011 11:31 PM
setting git-diff --color-words as git-diff potuz Linux - Software 5 09-09-2010 01:31 PM
Evolution Exchange detects exchange 5.5 sandbagger Linux - Newbie 1 06-30-2009 06:32 AM
Which qmail log file details outgoing mail? (have huge outgoing mail volume) hilljockey Linux - Server 2 12-08-2008 04:26 PM
Dual Boot diff Hard Disk diff OS on Suse 9.1 wilhem Linux - Newbie 1 08-13-2004 06:06 PM

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

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