First you have to determine what IP addresses you can use, what the proper NETMASK is for your netork, and what your GATEWAY address is. In addition you'll need to know what your DNS servers are, but this is probably already set correctly from your DHCP setup. There are many ways for you to determine all of this information but here is one way: On your redhat box look in the /var/lib/dhcp directory where you should find a file called "dhclient-eth0.leases" assuming your ethernet interface name is "eth0". In that file you should find your currently assigned IP address, your NETMASK and your GATEWAY (would be in the "routers" line). Let's say you determine your current DHCP assigned settings are:
IP Address: 192.168.1.199
GATEWAY: 192.168.1.1
NETMASK: 255.255.255.0
Now, your DHCP server assigns you an address from a range of addresses. If your router assigns your addresses you'll have to look at it to determine what the DHCP range is that it gives out addresses from. Now, pick an IP address that is outside of that range (so your DHCP server can't assingn an address to someone else that will conflict with you).
Say the DHCP server range is 192.168.1.100 through 192.168.1.200 then you could pick an address from 192.168.1.201 through 192.168.1.254 or 192.168.1.2 through 192.168.1.99 (your router is using 192.168.1.1 and you don't want to use the same address). Say you decide to assign 192.168.1.210 and 192.168.1.211 to your two Linux machines. Ping those addresses before assigning them to make sure you don't have anything else on those addresses. Ok, now on your Red Hat box you can use the graphical tool "redhat-config-network". Click on your "eth0" and click the "edit" button. Now click the "static" radio button and put in "192.168.1.210" for the IP address, 255.255.255.0 for the subnet mask, and 192.168.1.1 for the gateway address. That's it (you might need to click "deactivate" and then "activate" for it to set the address immediately). You can now check it with "ifconfig" and verify the address is assigned to your interface and do a "netstat -rn" to verify the gateway setting is correct. Everything should work just as it did when you had a DHCP assigned address.
Now on the Debian box I'll have to go from memory since I don't have a machine up at home right now with Debian, but I do have one at work. I believe the file you need to change is /etc/network/interfaces. You should have an entry for "eth0" and it will have the keyword "dhcp" next to it. You have to change that to "static". You also have to put your gateway, netmask and ip address information right below that. Sort of like this:
http://documents.made-it.com/Debian_Int ... ver-5.html
I believe your interfaces file would look something like this:
- Code: Select all
iface eth0 inet static
address 192.168.1.211
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
If you have trouble with it, paste in a copy of your interfaces file in a working dhcp configuration and I can tell you what you need. At any rate, once you get the addresses assigned you can edit the /etc/hosts file on both machines and put entries for them like this:
192.168.1.210 redhathostname.calumshouse.com redhathostname
192.168.1.211 debianhostname.calumshouse.com debianhostname
Of course if you were running a Linux DHCP server and dynamic DNS setup the DNS names would be configured automatically and you could continue to use DHCP. But you would need a dedicated machine to stay up all the time (probably an old junker without a monitor you would just leave under a desk somewhere and forget about).