Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd December 2011, 16:31
blocker blocker is offline
Senior Member
 
Join Date: Mar 2008
Posts: 177
Thanks: 9
Thanked 4 Times in 4 Posts
 
Default Linux multiple IP's on virtual interfaces

Hello,

here is the scenario: I have a box with 3 IP adresses, configured as virtual interfaces

192.168.0.1 eth0
192.168.1.2 eth0:0
192.168.0.3 eth0:1

i have also apache with ip based vhosts:

this one is bound to the IP which is configured on eth0:0
<VirtualHost 192.168.1.2:80>
....................................
</VirtualHost>

the problem is that when a connection FROM the vhost 192.168.1.2:80 is made to external host, the connection goes trough 192.168.0.1 eth0 and not trough 192.168.1.2 eth0:0, as i wish to...

whit SNAT i achieved to rewrite the default outgoing IP of the server but that is still not enough, since also in this case i have only one default outgoing IP

iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.1 -j SNAT --to 192.168.0.2

this way all the traffic goes trough 192.168.0.2 eth0:0, and the server remains reachable on all 3 IP's

what i want to achieve is, every apache IP based vhost to go out trough its specific IP


any thoughts and help are much appreciated!
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail-Problema jz_ HOWTO-Related Questions 9 14th September 2011 13:31
haresources multiple virtual ips hakkar Server Operation 0 28th September 2010 18:13
Unsupported memory accesses after HowTo Installing Xen On An Ubuntu 8.04 petervanbussel HOWTO-Related Questions 10 20th December 2009 19:46
Problems installing NForce4 sound drivers Wraithfire Installation/Configuration 21 16th April 2006 17:30
KErnel not showing all my memory Jorem Kernel Questions 8 13th April 2006 12:59


All times are GMT +2. The time now is 12:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.