Steve,

To setup a ethernet card to accpect packets from 2 differant IP address:

Say the two ip's are 
192.168.17.2 - ns1.domain.com
192.168.17.3 - ns2.domain.com

And you have 1 ethernet card in the server.  What you can do is what is
called a virtual IP.  Set the ethernet up as normal to 192.168.17.2,
then after that is up and working, bring up the second IP address by
using ifconfig:

/sbin/ifconfig eth0:1 192.168.17.3 up

or under Solaris 

/usr/sbin/ifconfig le0:1 192.168.17.3 up

What this does is bring UP a virtual IP on the first ethernet card, with
the IP address 192.168.17.3

The things you should note here, is the virtual IP you are bring up HAS
to be in your subnetmask or it will hang you ethernet card or worst.
If you have a full class C with a subnet mask up 255.255.255.0 and try
to bring up the IP address 206.231.66.122 on your ethernet device on the
192.168.17.* network, it will HANG you machine, if you are lucky that
is, the fun part is if the server is in another city :)

The second thing you should note, is that you can have multiply virtual
IP per ethernet card.  If you wanted to add a thrid virtual IP to this
ethernet card you could do it by using the command like so

/sbin/ifconfig eth0:2 192.168.17.4 up

See where it changed from eth0:1 to eth0:2, I know you can go up to
atleast 200, I haven't went passed that, so anything over 200 virtual IP
on one ethernet card you will be on your own.

The thrid thing to take note of, that the ip you are using can NOT be in
use by another device on your network, just play it safe and don't try
it.

If you want to take the device down, run the same command, but replace
"up" with "down".

Test it out by ping-ing both ip address, telnet-ing to both ip address
(assumes you have telnetd running), don't worry about host and domain
names at this point.  The 192.168.17.2 and 192.168.17.3 should both be
valid hosts on your network and the internet if they are registered.

Once the are working correctly you will need to edit your
/etc/rc.d/init.d or /sbin/init.d or /etc/rc.d files depending on your
distro and put the ifconfig command in there so when the system reboots
it will automatically setup the virtual IP for you.  This is a little
beyond the scope of the email, so I will let you find out where it goes,
it can vary between OS/distro's..  under Solaris it in under
/etc/intit.d/inetsvc and Linux it will be network(?!) or create you
own...

Alright now you have 2 IP on one machine, you shouldn't of had to reboot
any during this setup..

Now you can assign ns1.domain.com to 192.168.17.2 in your dns records
and 192.168.17.3 to ns2.domain.com in your dns records.

That is how you setup a virtual IP, the machine will respond to incoming
packets on either IP.


---
One thing I should say, is NEVER run 2 dns servers on the same computer,
it is not the best way to do it.  Either 1) spend $50 bucks on a 486 and
use that as you secondary DNS or 2) setup your internic records to use
ns1.domain.com as your primary dns and have your secondary dns that
doesn't exist, just give them the IP of where it should be, so when you
do get your $50 bucks you don't have to change internic records later. 
Don't try to run 2 dns servers on 1 computer, it defets the point of
having 2 servers and it would be very difficult, if at all possiable to
pull off.

Say you have 2 IP, lets say they are 192.168.17.2 and 192.168.17.3.  

Have you dns records    192.168.17.2 - ns1.domain.com  # machine 1
                        192.168.17.2 - mail.domain.com # machine 1
                        192.168.17.3 - ns2.domain.com  #machine 2 or no machine
                        domain.com. - MX mail.domain.com
etc. etc.

Hope that helps.
Jack



   
Steve Smale wrote:
> 
> Im probably overlooking something blatently obvious here, however...
> 
> I'm setting up a single machine to be housed in a server room to
> act as a mail server for a domain. As it happens, it's the only
> permanently-connected server on the domain.
> 
> I've been allocated two IP's to set up as ns1 and ns2, and told
> to put them both on the same machine, and I've pointed my NIC
> records for the domain to these two IP's. I dont see much point
> having an off-site secondary, as if the machine goes down, the
> mail server's down anyway, so you wont be able to connect, and
> as its the only machine on the domain nothing else will be
> affected!!...
> 
> Problem 1) How do i get the machine to respond to incoming packets
> to both IP's?? Any general guidance on setting up primary AND
> secondary dns on the same machine would be much appreciated too!!
> 
> Problem 2) I've read that you're not supposed to point MX records
> or NS Records to CNAMES - if there's only two IP's, that'll be
> one each for ns1 and ns2... I presume by this I cant Cname
> mail.domain.com to one of them, but are there any issused with
> more than one Resource Record pointing to the same IP?
> 
> Thanks for any help! Im on my fifth how-to now, and getting
> increasingly confused with each one i read!! Makes me wonder
> whether i should go register pink-padded-cell.org instead! ;-)
> 
> Cheers!
> Steve

Reply via email to