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 07-13-2009, 06:15 AM   #1
husaren
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
multiple eht0 aliases -Need to use specfic IP for client connection


Hi all. First post, so be gentle :-)

I have a webserver setup, where i need the server to have multiple eht:0 aliases in order to do some SSL-vhosting and other stuff.

The servers eh0 is set up in /etc/network/interfaces (its an Ubuntu)
And i have added the eth aliases with : ifconfig eth0:1 123.231.213.123 up command.

This works great, i can use the additional IPīs for the SSL-vhosts, and all is good.

My problem now is that while the server itself has 1 IP, (and approx 20 IP on alias interfaces) it uses random (i think) IPīs when it is to connect to other servers. E.g the main problem is that if a Vhost on the server sends out an email, the server uses a wrong IP in the headers. Thus making it seem like the email is coming from another IP than then on the Vhost itīs currently residing.

Currently, when the server connects to its smarthost in order to deliver emails, It connects from the IP that is bound to the eth0:0 interface, and not the IP bound to eth0 which is desired.

The question now is how do I sort out the IPīs so that all connections the server makes as a client, will use the first (Eth0) IP ?

And all the extra IP-adresses will only be used as "server addresses" not to make client requests.

Does it even make sense ?

Any help is greatly appreciated.

cheer
/Husaren
 
Old 07-13-2009, 01:48 PM   #2
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 108
Blog Entries: 1

Rep: Reputation: 25
I think I understand what you want.

You want all emailS sent from the server to appear to come from the ip bound to eth0. That would be a configuration of your mail server software on the server. Probably sendmail, postfix, or exim.

As for other client connections I'm not sure.


Btw I assume your outgoing emails are sent from the server not some smtp client In a vhosts code (like a php script connecting to another server). I don't have a clue for other outbound connections.
 
Old 07-14-2009, 02:41 AM   #3
husaren
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by cmdln View Post
I think I understand what you want.

You want all emailS sent from the server to appear to come from the ip bound to eth0. That would be a configuration of your mail server software on the server. Probably sendmail, postfix, or exim.
That is exactly what I want.

Quote:
Originally Posted by cmdln View Post
As for other client connections I'm not sure.


Btw I assume your outgoing emails are sent from the server not some smtp client In a vhosts code (like a php script connecting to another server). I don't have a clue for other outbound connections.
Well. All the Vhosts use PHPīs mail() which redirect the mail to localhost. Here Courer-mta accepts the mails and send them to a dedicated outbound SMTP-server. It is in the tranfer that the server connects to the dedi outbound SMTP as a client, and from another IP than the one bound to eth0.

Im not sure it helps to have Courier-mta listen on only a specific interface as im pretty confident this problem is regarding the inner workings of linux-networking.

In short, it would be nice to be able give som sort of prio to each of the eth interfaces.

Or be able to define that only eth0 should be used for outbound connections.
 
  


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
virtusertable vs. aliases and multiple recipients Skip-DMP Linux - Software 7 10-04-2009 06:14 AM
Inquiries about eht0 and eht0:1 thok Linux - Newbie 2 11-29-2007 05:12 AM
Cisco VPN client multiple connection fxtheatre Linux - Networking 0 09-08-2006 05:35 AM
Multiple aliases in apache 1.3.33 mdcapt Linux - Networking 1 02-12-2006 07:07 AM
Iptables, Multiple IP Aliases and Different Rules for each external ip genmud Linux - Networking 7 09-18-2005 02:07 AM

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

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