[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Serve DHCP on a machine with 1 nic?



Hi folks,

I have a machine with a static IP, on a network, plugged into a hub. This box only has one nic.

I'm trying to create an internal network on 192.168.1. for other machines plugged into that same hub.

What I'd like to do is have the machine act normally on eth0, but act as a gateway (NAT?) and DHCP server for machines on the 192.168.1.* network on eth0:0.

Can anyone give me some pointers for this?

I've tried first defining the alias:
ifconfig eth0:0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0 up
route add -net 192.168.1.0 dev eth0:0

Then I defined my dhcp.conf:
# option definitions common to all supported networks...
option domain-name "something.net";
option domain-name-servers <dns ip here>;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;   # not sure if this is correct
default-lease-time 600;
max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.10 192.168.1.100;
}

And then I was trying to use gShield to set up iptables to do the NAT. Unfortunately it didn't appear to like ip aliasing.

At one point I was /very/ close. A laptop I had was getting an IP via DHCP, but it couldn't get anywhere. Any help is greatly appreciated.

--
Bruce Z. Lysik  <eldrik@logrus.com>   http://www.logrus.com/~eldrik



Reply to: