Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

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

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
jmarkfoley
Asked:
jmarkfoley
1 Solution
 
rjanowskyCommented:
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
 
jmarkfoleyAuthor Commented:
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
 
rjanowskyCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arnoldCommented:
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
 
rajeev2353Commented:
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
 
jmarkfoleyAuthor Commented:
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
 
jmarkfoleyAuthor Commented:
Have not tried this yet, but I plan on doing so this weekend.
0
 
jmarkfoleyAuthor Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now