Stupid cband and mod_bw.
Sep. 9th, 2008 01:58 pmGeek pop quiz:
I have an Apache2 server.
I want to limit clients *over the internet* to a maximum connection speed.
I do not wish to limit clients *on the intranet* at all.
I have CBand installed, which lets me handily limit connections based on IP of the incoming connection.
The problem: People, both internally and externally, use the FQDN of the server. This means the same URL works in all places, right? That's wonderful, right?
Well, no. That resolves to the external IP, and connecting to the external IP from the intranet results in you resolving the FQDN to the external IP, sending your traffic to the IP, and the router catching it, saying "Oh, that's me", and forwarding it to the server. Meaning *all* connections appear to be coming from the router's IP.
Meaning, I can limit by IP, but I only ever see one IP.
Solutions?
I'm thinking, run a DNS server internally, accessible to the LAN only, with DHCP assigning this DNS as first, last, and only DNS server. This server knows the internal IPs of things and is convinced of it's own authoritativeness. For anything it doesn't know, it goes outside to the regular DNS.
So, connections from inside the firewall resolve the FQDN to the internal IP. Connections from the outside resolve it to the external IP. Cband is set to hinder only people on the outside.
Great, right?
Well, almost. First, CBand's website is down and their documentation is thus missing. Second, this is a lot of work and adds a new server that I don't want to run.
Who's got a magic bullet for me to solve this one?
("Buy a router that does the QoS restrictions for you" is cheating. Acceptable if you've got a suggestion on one for realtively cheap, but still cheating.)
I have an Apache2 server.
I want to limit clients *over the internet* to a maximum connection speed.
I do not wish to limit clients *on the intranet* at all.
I have CBand installed, which lets me handily limit connections based on IP of the incoming connection.
The problem: People, both internally and externally, use the FQDN of the server. This means the same URL works in all places, right? That's wonderful, right?
Well, no. That resolves to the external IP, and connecting to the external IP from the intranet results in you resolving the FQDN to the external IP, sending your traffic to the IP, and the router catching it, saying "Oh, that's me", and forwarding it to the server. Meaning *all* connections appear to be coming from the router's IP.
Meaning, I can limit by IP, but I only ever see one IP.
Solutions?
I'm thinking, run a DNS server internally, accessible to the LAN only, with DHCP assigning this DNS as first, last, and only DNS server. This server knows the internal IPs of things and is convinced of it's own authoritativeness. For anything it doesn't know, it goes outside to the regular DNS.
So, connections from inside the firewall resolve the FQDN to the internal IP. Connections from the outside resolve it to the external IP. Cband is set to hinder only people on the outside.
Great, right?
Well, almost. First, CBand's website is down and their documentation is thus missing. Second, this is a lot of work and adds a new server that I don't want to run.
Who's got a magic bullet for me to solve this one?
("Buy a router that does the QoS restrictions for you" is cheating. Acceptable if you've got a suggestion on one for realtively cheap, but still cheating.)
(no subject)
Date: 2008-09-09 06:23 pm (UTC)(no subject)
Date: 2008-09-09 06:32 pm (UTC)However, it *does* require a username and password to access it. I wonder if I can restrict based on that in the .htaccess files, somehow?
(no subject)
Date: 2008-09-09 06:32 pm (UTC)Oh, helps to read everything. You don't already have internal DNS. You suck. How do you run an internal network without internal DNS? Or do i want to know?
(no subject)
Date: 2008-09-09 06:34 pm (UTC)Oh, well. If there's no easier fix, that one's not hard.
(no subject)
Date: 2008-09-09 06:41 pm (UTC)It's a single /24 subnet with a dozen static IPs, a VPN range, and a standard DHCP range. Internal name resolution is done via WINS, because there's a Samba server sitting in the middle of it all, and the DHCP server sends out the WINS address.
The network was set up by blind, drunken, home-user monkeys, and I'm a contractor arriving long after the fact. Anything that works, I do not touch - which is why they're still running a WRT54G version *2* as their "corporate" router. As their needs evolve and they require new functionality, I fix each bit up to a semi-reasonable small-business spec.
(no subject)
Date: 2008-09-09 06:43 pm (UTC)(no subject)
Date: 2008-09-09 06:46 pm (UTC)(no subject)
Date: 2008-09-09 06:49 pm (UTC)(no subject)
Date: 2008-09-09 10:46 pm (UTC)Whereas for me, I am my own boss, I have more clients than I know what to do with and so I'm referring them to my friends and acquiantances, I'm making good money, and I'm having *fun* with the new problems and strange experiences that happen when you're called in to fix things in a startup that's gotten just a little too big to do things themselves, but not big enough to afford a guy like me full-time.
Absolutely, bad setups can be frustrating, but these are all cases where they *know* it's bad, they know *how* it's bad (if not why) and they've called me in specifically because they want me to tell them what it will cost to make it better.
(no subject)
Date: 2008-09-09 06:48 pm (UTC)(no subject)
Date: 2008-09-09 06:58 pm (UTC)I like that in a service.
(no subject)
Date: 2008-09-09 06:34 pm (UTC)"I'm thinking, run a DNS server internally, accessible to the LAN only, with DHCP assigning this DNS are first, last, and only DNS server. This server knows the internal IPs of things and is convinced of it's own authoritativeness. For anything it doesn't know, it goes outside to the regular DNS."
That is exactly the way I would and have solved this problem. You don't even have to cache DNS queries - though it does speed up internal name resolution performance, lightens the load on your upstream DNS server, etcetera. And lets you be the fascist BOFH when you wish to.
(no subject)
Date: 2008-09-09 06:39 pm (UTC)And no, not running an internal DNS, yet. The network was set up by blind, drunken, home-user monkeys, and I'm a contractor arriving long after the fact. Anything that works, I do not touch - which is why they're still running a WRT54G version *2* as their "corporate" router.
(no subject)
Date: 2008-09-09 06:45 pm (UTC)*capable of supporting GPL firmware
They're blind, drunken, home-user monkeys - but not so blind or drunken that they have a Microsoft box sitting somewhere waiting to be told it is the authoritative DNS proxy?
(no subject)
Date: 2008-09-09 06:53 pm (UTC)(no subject)
Date: 2008-09-09 06:56 pm (UTC)So yeah. The version 2 can, totally, do what he wants it to.
(no subject)
Date: 2008-09-09 06:58 pm (UTC)(no subject)
Date: 2008-09-09 07:04 pm (UTC)(no subject)
Date: 2008-09-09 07:05 pm (UTC)I'm just saying, the v2 *can* be flashed with the standard open freeware. You don't strictly need the L.
(no subject)
Date: 2008-09-09 06:57 pm (UTC)*blithely looks at WRT54G specs*
VERY much.
(no subject)
Date: 2008-09-09 06:54 pm (UTC)So when they needed a server, he built them a (pretty nice, actually) Debian box and set it up to run CVS and Bugzilla and MediaWiki and integrate them. When they needed a network, he bought them a router, plugged it in, left all the defaults set, and called it good.
So it was a mixed bag, all things considered. "Blind, drunken, home-linux-user monkeys", maybe?
But no, no handy Win2K3 server gathering dust. However, it's really not hard to set up bind to do what I want it to. It's exactly the setup that Zimbra uses, and I've set up Zimbra repeatedly.
(no subject)
Date: 2008-09-09 06:50 pm (UTC)That way you can distinguish connections based on the incoming port, and run Apache on both ports, but also use the port to restrict bandwidth.
Might not work for you but it's a suggestion.
(no subject)
Date: 2008-09-09 06:51 pm (UTC)(no subject)
Date: 2008-09-09 10:01 pm (UTC)I ended up having to put the FQDN in hosts.
The speedtouch does feature a DNS proxy, incidentally -- it's just that all it can add into the net is "speedtouch.lan" and ".lan".
(no subject)
Date: 2008-09-09 10:03 pm (UTC)the hosts file is the first place used for resolution, so it 'aces' everything else. and assuming not too many client machines, it's not a huge headache to change.
(no subject)
Date: 2008-09-09 10:05 pm (UTC)(no subject)
Date: 2008-09-09 10:41 pm (UTC)(no subject)
Date: 2008-09-09 10:40 pm (UTC)But hosts are a good thought.
(no subject)
Date: 2008-09-10 10:16 am (UTC)local dns server for the win, though.
(no subject)
Date: 2008-09-09 10:34 pm (UTC)If not, running your own bind instance is the best long term solution.
(no subject)
Date: 2008-09-09 10:40 pm (UTC)(not happening)
So, yeah, there seems to be a consensus. All good!
(no subject)
Date: 2008-09-10 03:11 am (UTC)prk.
(no subject)
Date: 2008-09-15 02:37 am (UTC)Tell the Apache2 server to also act like a caching http proxy for internal users to access the internet through. Set their browser proxy to be the internal IP of the Apache2 server.
Or is that an additional point of failure?
(no subject)
Date: 2008-09-15 12:24 pm (UTC)But thanks!