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

Re: Serve DHCP on a machine with 1 nic?



On Tue, 2001-11-20 at 14:39, Bruce Z. Lysik wrote:
> 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.

Have you tried binding your dhcpd server to the eth0:0 interface (I'm
still looking for the elegant way) by adding the interface name in the
init.d/dhcp file after dhcpd:
			  ______
ie --exec /usr/sbin/dhcpd eth0:0 -- -q

where appropriate?

This sounds more like an iptable problem.  Perhaps the firewall config
posted to the list would help an iptables guru debug it.  I'm still an
ipchains user at the moment.

--mike








Reply to: