Solved

configure DHCP on Linux for wireless access point and wired interface at the same time

Posted on 2013-06-19
8
292 Views
Last Modified: 2014-05-02
I have a Linux server acting as a router. It has an Internet facing NIC card (eth0) and a LAN facing card (eth1). I recently added a wireless card (wlan0) as an access point which appears to work (it shows up on other wireless devices).  IP's are:

eth0 - dynamic IP from the Cable modem
eth1 - 192.168.0.1
wlan0 - 192.168.0.2

My dhcp.conf is:
authoritative;
option domain-name "alluneedizluv.local";
ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.255.0 {
    option routers 192.168.0.1;
    range 192.168.0.100 192.168.0.199;
    option domain-name-servers 209.18.47.61, 209.18.47.62;
}

host rover {
  hardware ethernet 44:1E:A1:C8:E8:9B;
  fixed-address 192.168.0.102;
}

Open in new window


I want to include the wireless card for wireless clients to get DHCP addresses. Note that whether host rover connects via wire or wireless, I want it to get 192.168.0.102.

I'm not sure how to configure this. All web examples I've seen for wireless are showing either only the wireless being configured for DHCP, or two subnets with different ranges. I've not found an example for two interfaces on the same range.

I tried:

option routers 192.168.0.1 192.168.0.2;

but that gave a "semi-colon expected" configuration error.

Any ideas?
0
Comment
Question by:jmarkfoley
8 Comments
 
LVL 10

Expert Comment

by:rjanowsky
ID: 39261680
Why are you using the same class c network for wired and wireless? What about using one net for wired (192.168.0.0) and one for wireless (192.168.1.0). In that case your router/dhcp server can have two scopes, which are independent from each other. By the way the host rover has different mac addresses for the lan and the wlan card.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 39262326
I could do separate subnets. In fact, I have set it up this way currently. Maybe what I want is not possible. I've had commercial routers (Linksys, D-Link) where I could specify a DHCP reservation for various hosts and they would get that reservation regardless of whether the host connected via wireless or wired.
0
 
LVL 10

Expert Comment

by:rjanowsky
ID: 39262438
Yes, you can have a reservation for one unique mac address. But in your situation you have two unique network cards and also two addresses. I don't know, if there is a DHCP server, which can assign two mac addresses for one reservation. You wrote your linux server is acting as a router. To realize different media technologies (wired & wireless), your router must bridge the two segments. The configuration with two subnets seems for me a good and usable one.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 39263008
If you use the same IP block, you have to bridge the wlan0 interface to the eth0 such that wlan0 will not have an IP.
http://xmodulo.com/2013/04/how-to-configure-linux-bridge-interface.html

The multi segment is a way to maintain additional control dealing with shielding one segment from the other.
0
 
LVL 3

Expert Comment

by:rajeev2353
ID: 39264973
hi,
please use only one router ip and you can mention range for eth0 and eth1.
again you can add wireless mac address or ip for reservation. then your dhcp server will running wel.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 39302802
Sorry for the delay in response.

rjanowsky: > By the way the host rover has different mac addresses for the lan and the wlan card.

The host "rover" is not the one hosting the LAN/WLAN interfaces. it is a host on the LAN. So, rover should alway have the same MAC address.

> The configuration with two subnets seems for me a good and usable one.

Yes, and that is working now, currently, my subnets are:

# This subnet is for eth1, the wired LAN connection
subnet 192.168.0.0 netmask 255.255.255.128 {
    option routers 192.168.0.1;
    range 192.168.0.100 192.168.0.126;
    option domain-name-servers 209.18.47.61, 209.18.47.62;
}

# This subnet is for wlan0, the wireless LAN connetion
subnet 192.168.0.128 netmask 255.255.255.128 {
    option routers 192.168.0.129;
    range 192.168.0.130 192.168.0.254;
    option domain-name-servers 209.18.47.61, 209.18.47.62;
}

(thanks to arnold, see http://www.experts-exchange.com/Networking/Linux_Networking/Q_28162388.html)

but I would like the host "rover" to get the same IP from the linux router whether it connects via wired or wireless. That's the goal. Right now, if I connect via wired it gets 192.168.0.102; if via wireless I get  192.168.0.136-ish.

I will check out arnold's bridge suggestion and get back with the results.
0
 
LVL 1

Author Comment

by:jmarkfoley
ID: 39601155
Have not tried this yet, but I plan on doing so this weekend.
0
 
LVL 1

Author Closing Comment

by:jmarkfoley
ID: 40037245
I haven't actually tried this solution yet because I'm switching from Slackware to Debian. However, it does appear that arnold's link would put me on the right path. I will likely re-post when I get the Debian setup working well.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What antennae works with Linux? 7 83
Centos Rescue and NFS Share 4 66
Linux Login using LDAP or Active Directory 4 127
High Bandwidth Usage 6 57
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question