Viewing 21 posts - 1 through 21 (of 21 total)
  • Linux experts… DHCP client _and_ server?
  • willard
    Full Member

    I’m re-roleing one of my Raspberry Pis to act as a wireless access point (using WPA-Supplicant), but I need the wired ethernet to act as a DHCP client whilst the wireless is acting as a DHCP server.

    Is such a thing possible?

    ffej
    Free Member

    Won’t that mean there are two DHCP servers running on the same network? Your WAP and whatever the WAP is getting its IP address from?
    My understanding is that this will cause problems.

    Is there a reason why your WAP can’t have its ip fixed and set outside the DHCP range?

    Jeff

    trailwagger
    Free Member

    Out of touch with such things nowadays, but wouldnt it be easier to use DHCP passthrough, so wifi clients get their addresses from the dhcp server on the wired side?

    Fresh Goods Friday 696: The Middling Edition

    Fresh Goods Friday 696: The Middlin...
    Latest Singletrack Videos
    willard
    Full Member

    Like I said, the wired side network is not entirely trusted, so the plan was to go DHCP for that, then have the Pi act as a firewalled router on its own little network, giving DHCP to the wireless clients.

    DHCP passthrough may be an option, but I have no idea how big the scope is on the other side, just that i can get one IP address.

    trailwagger
    Free Member

    Like I said, the wired side network is not entirely trusted, so the plan was to go DHCP for that, then have the Pi act as a firewalled router on its own little network, giving DHCP to the wireless clients.
    DHCP passthrough may be an option, but I have no idea how big the scope is on the other side, just that i can get one IP address.

    Where did you say that?

    Anyway, sounds like you are trying to piggyback onto someone elses network, im out.

    molgrips
    Free Member

    Won’t that mean there are two DHCP servers running on the same network?

    No – if you are using different network adapters then they are different networks, aren’t they?

    Aren’t you making your Pi into a router, in this situation? The wireless clients would have an extra network hop and a different subnet.. isn’t this an entirely normal situation?

    I’m not a network engineer mind.

    trailwagger
    Free Member

    No – if you are using different network adapters then they are different networks, aren’t they?
    Aren’t you making your Pi into a router, in this situation? The wireless clients would have an extra network hop and a different subnet.. isn’t this an entirely normal situation?
    I’m not a network engineer mind.

    You are correct I believe, but I cannot think of a reason why the OP would have no knowledge of the wired side of his network (unless it wasnt his network of course)

    willard
    Full Member

    trailwagger, you’re right. I think I might have thought the bit about not entirely trusted wired networks, rather than said it. It happens a lot, sorry.

    The network is in a building and is designed for just using as wired. That’s great, but the socket is in a cupboard and not anywhere even remotely convenient. It would be a lot easier to connect to the network using WiFi from iPhones, iPads, etc, hence the reason for the gateway.

    Aidy
    Free Member

    Should be entirely possible, I’ve done similar with openbsd.

    trailwagger
    Free Member

    So you need something like this

    http://www.glennklockwood.com/sysadmin-howtos/rpi-wifi-island.html

    *edit* but i think you will need a static ip on the wired side for the NAT to work??

    molgrips
    Free Member

    I’ve got several old routers here you could have…?

    willard
    Full Member

    Routers or motors Molgrips? Dare I trust the hardware of a man with such poor luck in cars? 😀

    trailwagger. That looks good. I thin that is pretty much what I am after and I might be able to get a static IP for the eth0 end of things.

    codybrennan
    Free Member

    Doable, but something to consider is whether you are wanting to NAT the entire Pi range behind one IP address, or have the Pi route its LAN to the existing domestic router.

    If its the former, should be ok. If its the latter, could be a problem, as most domestic routers dont want to know about routing to other subnets, other than the default to the gateway. Playing around with many of them, I think most of the ISP-derived ones lack the ability to add a route-statement in.

    ceept
    Full Member

    Why not just buy a router with an RJ45 socket for the WAN connection. I have done that a few times to isolate my LAN from everyone else using the same wired internet connection.

    willard
    Full Member

    I have a wireless modem/router with an RJ45 WAN socket (and a HomeHub4), but the WAN socket seems dedicated to the ISP and, in the case of the HoneHub at least, asks for nothing more than BT login details, no other config options. I have not tried the other router yet.

    codybrennan
    Free Member

    Yeah, so the Rpi would need a different DHCP scope and LAN in that case, and the ability to do NAT overload on a single IP address. Not impossible.

    brassneck
    Full Member

    It’s possible but not worth it beyond interest – you actually probably want DHCP relaying rather than serving unless you don’t trust the wired network .. in which case don’t connect to it without proper precautions 🙂

    What eeept said is the easiest – if you set the WAN port to DHCP you’ll get a valid address from the wired side and NAT the wireless side off into a normal public class c. Probably some basic filtering on there too. I use some TP Link jobbies for similar non critical tasks

    flashpaul
    Free Member

    just buy a cheap router

    They are often called cable routers and should be under £20

    If you want to use the pi though I think you can install open wrt , this should work as well

    xora
    Full Member

    https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=gl.inet

    These guys are what I use for similar issues, they are running OpenWRT and is everything you need out of the box for as little as £20. So its basically just choose what other features you want.

    rossburton
    Free Member

    You don’t need a router, just a wifi access point. It will bridge and forward to the wired network for you. The RPi *can* do that but unless you’re doing it as a learning exercise, just buy something from amazon.

    willard
    Full Member

    Cheers all. I’ll have a browse of the shop and see what comes up

Viewing 21 posts - 1 through 21 (of 21 total)

The topic ‘Linux experts… DHCP client _and_ server?’ is closed to new replies.