LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2005, 11:45 PM   #1
scng
Member
 
Registered: Sep 2004
Location: Hong Kong
Distribution: Fedora Core 3
Posts: 53

Rep: Reputation: 15
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?
 
Old 07-12-2005, 12:08 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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
 
Old 07-12-2005, 08:48 AM   #3
scng
Member
 
Registered: Sep 2004
Location: Hong Kong
Distribution: Fedora Core 3
Posts: 53

Original Poster
Rep: Reputation: 15
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......
 
Old 07-12-2005, 09:57 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP subnets klnasveschuk Linux - Networking 2 11-17-2007 11:04 PM
DHCP assignments across two subnets otisthegbs Linux - Networking 5 04-24-2004 11:16 PM
TFTP server not serving in slackware 9.1 cjdock Slackware 8 10-16-2003 01:33 PM
how can i create subnets on dhcp server castify Linux - Networking 0 07-24-2003 03:13 AM
DHCP server with multiple nics and subnets hawkpaul Linux - Networking 6 12-20-2001 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration