LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   One DHCP server serving 2 subnets (https://www.linuxquestions.org/questions/linux-networking-3/one-dhcp-server-serving-2-subnets-342333/)

scng 07-11-2005 11:45 PM

One DHCP server serving 2 subnets
 
My linux box has 3 NICs:

eth0 -> connected to the Internet
eth1 -> ip:192.168.1.1
wlan0 -> ip:192.168.0.1

eth0 obtains ip thru' dhclient w/o problem.
i want to setup a DHCP server that provides IPs to clients connected via eth1 and wlan0 and they are supposed to be on 2 different subnets.

my dhcpd.conf is as follows:

Code:


subnet 192.168.1.0 netmask 255.255.255.0
{
        range 192.168.1.100 192.168.1.200;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.1.255;
        option domain-name-servers 123.123.123.10, 123.123.123.20;
        option routers 192.168.1.1;
}

subnet 192.168.0.0 netmask 255.255.255.0
{
        range 192.168.0.100 192.168.0.200;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.0.255;
        option domain-name-servers 123.123.123.10, 123.123.123.20;
        option routers 192.168.0.1;
}

the client connected via eth1 works well and can obtain an ip 192.168.1.100 successfully.

however, another client (myLaptop) connected wirelessly, via wlan0 can obtain 169.254.x.x automactically. of course, it cannot ping the gw 192.168.0.1. when i tried to manually type the ip 192.168.0.100 netmask 255.255.255.0 gw 192.168.0.1 in myLaptop, it worked then. it indicates that there is no problem for my wireless lan settings. so i guess there is some problem for the dhcp settings. how to bring it work?

win32sux 07-12-2005 12:08 AM

did you make sure you aren't blocking the incoming and/or outgoing "DHCP packets" on the wireless interface with iptables??

Code:

iptables -I INPUT -p UDP -i wlan0 --dport 67 --sport 68 -j ACCEPT
iptables -I OUTPUT -p UDP -o wlan0 --dport 68 --sport 67 -j ACCEPT


scng 07-12-2005 08:48 AM

thanks, but it still dun work

i updated the iptables, which is now:

Code:

Chain INPUT (policy ACCEPT)
target    prot opt source              destination       
ACCEPT    udp  --  anywhere            anywhere            udp spt:bootpc dpt:bootps
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:5900
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:microsoft-ds
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:netbios-ssn
ACCEPT    udp  --  192.168.0.0/24      192.168.0.1        udp dpt:netbios-dgm
ACCEPT    udp  --  192.168.0.0/24      192.168.0.1        udp dpt:netbios-ns
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:https

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination       
ACCEPT    udp  --  anywhere            anywhere            udp spt:bootps dpt:bootpc

the scenario remains the same......

win32sux 07-12-2005 09:57 AM

Quote:

Originally posted by scng
thanks, but it still dun work

i updated the iptables, which is now:

Code:

Chain INPUT (policy ACCEPT)
target    prot opt source              destination       
ACCEPT    udp  --  anywhere            anywhere            udp spt:bootpc dpt:bootps
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:5900
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:microsoft-ds
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:netbios-ssn
ACCEPT    udp  --  192.168.0.0/24      192.168.0.1        udp dpt:netbios-dgm
ACCEPT    udp  --  192.168.0.0/24      192.168.0.1        udp dpt:netbios-ns
ACCEPT    tcp  --  192.168.0.0/24      192.168.0.1        tcp dpt:https

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination       
ACCEPT    udp  --  anywhere            anywhere            udp spt:bootps dpt:bootpc

the scenario remains the same......

the policies on all your chains are ACCEPT, so all of those ACCEPT rules you have are pointless... either way, the fact your firewall is totally open pretty much rules-out a firewall issue i guess... does dhcpd work properly on eth1 (192.168.1.0/24)?? oh, wait, i just re-read your post and you stated dhcpd is working well on eth1... hmmm... i'm not sure what it could be... are you using SELinux??


All times are GMT -5. The time now is 05:53 PM.