Koozali.org: home of the SME Server

Multiple IP's on one SME server

Tom Carroll

Multiple IP's on one SME server
« on: March 24, 2002, 10:09:37 AM »
I have a need to host a virtual domain on my SME server, but the domain needs its own IP address.

I presently have my SME server set up on an ADSL account with two static IP addresses.  I have my primary domain, and two virtual domains on the server.  One of the virtual domains needs its own IP address for reverse lookup purposes.

My ISP is willing to add the reverse lookup records to his DNS but I have no idea what I need to do to add the second IP to my SME and have it answer correctly.

Is there an RTFM for this specific situation?  I tried searching the forums, but didn't turn up anything useful.

Thanks!


Tom Carroll
Dataware Computers

guestHH

Re: Multiple IP's on one SME server
« Reply #1 on: March 24, 2002, 01:40:14 PM »
Hi Tom,

To get you on the way, try this as root:

ifconfig eth0:0 192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0

and enter: ifconfig to see you new IP on eth0

Regards,
RequestedDeletion

ps. Of cource this is just quick help. You should make a template for the addition of the second IP on eth0

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #2 on: March 25, 2002, 04:54:06 AM »
guestHH wrote:
>
> Hi Tom,
>
> To get you on the way, try this as root:
>
> ifconfig eth0:0 192.168.1.2 broadcast 192.168.1.255 netmask
> 255.255.255.0
>
> and enter: ifconfig to see you new IP on eth0
>
> Regards,
> RequestedDeletion
>
> ps. Of cource this is just quick help. You should make a
> template for the addition of the second IP on eth0

Right, but will this work for external IP's?

If it would, I am assuming I would do this:

ifconfig eth1:0 207.41.94.221 broadcast 207.41.94.221 netmask 255.255.255.0
ifconfig eth1:1 207.41.94.222 broadcast 207.41.94.222 netmask 255.255.255.0

I'm not sure I have any idea what I am talking about.  My intuituion may be wrong here...

Can I assign two external IP addresses to one NIC on eth1?

Tom Carroll
Dataware Computers

guestHH

Re: Multiple IP's on one SME server
« Reply #3 on: March 25, 2002, 03:12:06 PM »
Hi Tom,

as long as it is a valid ip address, yes.

Just give a try and let us know ;-)

Regards,
guestHH

guestHH

Re: Multiple IP's on one SME server
« Reply #4 on: March 26, 2002, 11:13:17 AM »
Hi Tom,

Came across this one:
http://www.tech-geeks.org/index.php?topic=how-to&page=2

Titeled 1:1 NAT.

Maybe it helps.

Regards,
guestHH

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #5 on: March 26, 2002, 11:50:04 PM »
Thanks, but I think what I just did works just fine.  I did this:

ifconfig eth1:1 207.41.94.222 broadcast 207.41.94.555 netmask 255.255.255.0

Here is what my ifconfig shows now for my eth1:

eth1      Link encap:Ethernet  HWaddr 00:90:27:35:4E:78  
          inet addr:207.41.94.221  Bcast:207.41.94.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4904213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3876338 errors:0 dropped:0 overruns:0 carrier:0
          collisions:30092 txqueuelen:100
          Interrupt:30 Base address:0xeca0
 
eth1:1    Link encap:Ethernet  HWaddr 00:90:27:35:4E:78  
          inet addr:207.41.94.222  Bcast:207.41.94.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:30 Base address:0xeca0

Both IP's are now responding to pings.  I will have my ISP enter the RDNS entries for both domains.

This is only temporary since I did this from the command line.

Any idea what template I would have to modify to ensure this setting remains after a server reboot?

Thanks for your help!

Tom Carroll
Dataware Computers

guestHH

Re: Multiple IP's on one SME server
« Reply #6 on: March 27, 2002, 02:18:52 AM »
Hi Tom,

Glad it works for you.

Now for the template... I think you have to ask MITEL (dev-info) for i just don't know.

As long as you don't reboot or restart network service you'll be fine for now.

Regards,
guestHH

Hasan Muhammad

Re: Multiple IP's on one SME server
« Reply #7 on: March 27, 2002, 04:07:06 PM »
Try
/etc/rc.local
by adding or mod'ing
/etc/e-smith/templates-custom/etc/rc.local

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #8 on: March 27, 2002, 08:55:56 PM »
Evidently my ifconfig did not work.  My friend who has cable tried to ping the second IP without any results, so evidently the external IP is not responding from outside my network.

I put the second IP on eth1:1, should I instead try it on eth1:0?

Tom Carroll
Dataware Computers

Les Mikesell

Re: Multiple IP's on one SME server
« Reply #9 on: March 27, 2002, 10:55:06 PM »
SMEserver still has Redhat under the covers, so if you know what RedHat would put in /etc/sysconfig/network/scripts/ifcfg-eth0:0 and duplicate it, SME will install it at startup.  The harder problem is dealing with the IPchains firewalling which is template controlled and very strict.   Look at /etc/rc.d/init.d/masq and the corresponding template.  If you just want one or two protocols to work on the new address it isn't too hard to modify the template to permit them to go through.

guestHH

Re: Multiple IP's on one SME server
« Reply #10 on: March 27, 2002, 10:56:04 PM »
Hi Tom,

I think you're right there. The first 'virtual IP' is always 0, so eth1:0

Regards,
guestHH

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #11 on: March 30, 2002, 12:10:59 PM »
I have looked at the templates and the current masq file.  I do not understand what I am looking at.

I also did an ipchains --list to see what it showed.  That is the only place I see my external IP.

What do I have to modify to allow pop3/smtp/imap/web to work for the second external fixed ip?

I appreciate any help you can provide!


Tom Carroll
Dataware Computers

guestHH

Re: Multiple IP's on one SME server
« Reply #12 on: March 31, 2002, 07:10:23 PM »
Hi Tom,

For users to access e-smith related web-services via the 'virual-IP' you have to make sure that the httpd.conf listens to the new IP.
You have to make a custom template for httpd.conf and add sections for the new IP.

Regards,
guestHH

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #13 on: March 31, 2002, 08:56:38 PM »
I modified my httpd.conf file and changed the IP address on the virtual domain to the second assigned IP address, verified I had it entered for eth1:0 and still not responding.

Tom

Tom Carroll

Re: Multiple IP's on one SME server
« Reply #14 on: April 04, 2002, 08:01:54 AM »
Okay, I finally got the ping to respond.  I had to add a script for eth1:0, but now my port 25 and 110 are not open for connections.  That is all I need to do now in order to get the second IP complete.

Any ideas?