http://www.adamsinfo.com/apnic-box-linux-on-a-mikrotik-532a-part-1/
I put this device together for fun sometime around the start of 2007. The ideas that spawned this was using OpenWRT on a Linksys WRT54G access point. A surprisingly powerful and full linux distro with all kinds of advanced capabilities running on a Linksys wireless router which I’d previously thought to be a reasonably dumb device with computing power more comparable to a calculator than a PC. The project opened my eyes to embedded devices, and I wondered what device base I should start with. To cut a long story short and for reasons that I can’t even remember anymore I came across the Mikrotik Routerboard 532A and decided that I should start with that.
Conception APNIC Box Image 1
APNIC Box Image 1
Here’s a picture of the device from the outside with some labels, view the full image to see them.
1. Status LEDs. Blue at the bottom left shows it’s on, orange at the top right shows that there’s wifi activity. 2. Ethernet (eth0) 3. Standard Serial Console (57600, 8 N 1) 4. Ethernet (eth1) 5. Ethernet (eth2)
You’ll notice a PicoLCD unit from mini-box.com on top of the device, I’ll dedicate a separate section to that. For the moment, eth0 connects to a switch and my local lan on the 192.168.100.0/24 range. eth1 holds a public IP and is connected to my first ISP via a ADSL2+ modem (I generally get about 14mbit down and 1.5mbit up stable), and eth2 is connected to the same provider via a separate ADSL2+modem (I get about 16mbit down and 1.7mbit here). The ISP does not bond these connections – I wish :-). They are two entirely separate connections to the same ISP. This isn’t for redundancy as realistically unless you use cable which isn’t available in my area, any fault will usually be with BT (the network/telecoms provider) and so using two separate ISPs won’t really add any great redundancy factor. BETHERE (my ISP) are the only UK ISP that I know of to offer the 24mbit down/2.5mbit up service. Anyway, I guess the speed difference over the two lines is down to one connection to the exchange being slightly shorter or maybe cleaner shrug
linux
adsl2+
routerboard
redundancy
linksys
OpenWRT
routing
router
console
User:davidapnic
http://www.adamsinfo.com/bandwith-limiting-with-linux-tc-and-iproute2/
I’ve recently optimized the scripts used for bandwidth management in one of our UK facilities and I thought I’d post a quick howto on it.
My setup here is a live feed entering eth0 on this linux router and leaving eth1 into a switch connected to a collection of other servers. This is set up as an unrestricted public router, routing between a /30 on eth0 and a /24 on eth1. Note: We can’t in any way restrict the amount of traffic that eth0 receives from the outside, so instead we restrict how fast eth0 sends data out, the same applies the other way round. So, if we want to limit the amount of data that the local servers can send, we shape the router’s external interface (eth0). If we want to limit the amount of data that the local servers can receive, we shape the router’s internal interface (eth1)
With Debian Etch on 2.6.x, run: apt-get install tc iproute2 bc
Then script as follows:
I have tried not to get bogged down with too many irrelevant details here and would be happy to answer any questions or take any corrections. It’s pretty simple and it works well. Install bmon and you can confirm this yourself. The purpose of this is that I can take a 10mbit connection and limit the traffic to 5mbit ensuring that I don’t break the 95th percentile that I want to maintain at the datacenter. I can increase and decrease this at any time as traffic requires or permits respectively.
linux
percentile
routing
shaping
apt-get
interactive
router
management
Debian
qdisc
Quagga is an IPv4/IPv6 protocol routing suite, forked from the defunct GNU Zebra open source router development project.
Quagga provides an implementation of OSPFv2, OSPFv3, RIPv1/v2/v3 and BGPv4.
Quagga consists of a daemon that abstracts the underlying Unix kernel and presents a Zserv API over a Unix or TCP stream to a Zserv client, such as ospfd, ripd, ospf6d, ripngd, or bgpd.
Quagga also includes a tool called vtysh, which serves as an administrative front end to multiple daemons.