Solved

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

Posted on 2013-06-19
8
288 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
 
LVL 76

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now