[Posted and mailed]
Quote:> I have been using IP Masquerading for about three months now. I am running
> RedHat 6.1 on an old P 133 machine. My internet connection is a static IP
> address with a DSL modem. There are two NICs. One connects to the DSL
> modem, the other to a Windows NT machine. My IP address for the NT machine
> behind the firewall is the first Class C address available, 192.168.0.2 with
> a gateway of 192.168.0.1. I plan to add a hub behind the firewall in order
> to share the internet with a laptop. The obvious plan is the assign the
> laptop with an IP address of 192.168.0.3. But on the LAN at work the laptop
> will get its address dynamically. I don't want to constantly be changing
> the TCP/IP settings between work and home. Is there a way with IP
> Masquerading to assign IP addresses in this manner. It will help me a lot.
The best solution is probably to use DHCP. On the IP masquerading
computer, install and run DHCPD, the DHCP daemon. You could then use an
/etc/dhcpd.conf file that looks something like this:
default-lease-time 6000;
max-lease-time 10000;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
option domain-name "yourdomain.com";
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.50 192.168.0.75;
Quote:}
host laptop {
hardware ethernet 00:05:02:a7:76:da;
fixed-address 192.168.0.3;
Quote:}
You'll need to change a few things, obviously, to fit your specific
network. This configuration gives the laptop a fixed IP address, based on
the MAC address of its Ethernet adapter. (You can do the same for your
existing NT machine.) If you run DNS locally, this is useful because you
can hard-code the machine name in DNS. (If you don't run DNS locally,
you'll need to list your ISP's DNS servers on the "option
domain-name-servers" line.) If you don't have your own registered domain
name, I recommend using something with a fake top-level domain, like
"fakedomain.foo".
On the laptop, configure it to use DHCP. In Windows, I believe this is
called "obtain IP address automatically" or something similar. The result
is that when you plug the computer into your home network, you'll get the
192.168.0.3 address and a suitable machine name, whereas when you plug it
into your work network, you'll get an appropriate IP address and machine
name for that location.
--
http://www.rodsbooks.com
Author of books on Linux networking & WordPerfect for Linux