Gentoo Firewall/Gateway with Traffic Shaping I

By , September 26, 2007 9:44 pm

Intro

Ok, so this is a new little project of mine that I’ve just started. The idea is that I’ll end up with a machine that acts as an internet gateway for my home network with a few added features – Specifically, Traffic Shaping.

 

The reason for this is twofold – firstly, I have ADSL so too much upstream traffic results in very little downstream, and Secondly, at least two of the household are likely to use P2P programs, which generate lots of upstream traffic. So, I figured that rather than take the easy route and just make sure the upload traffic is limited at the client, I’d go for a far more interesting and complex approach and get and old Linux box to do some traffic shaping. This of course, does have the added advantage that I’ll be able to guarantee everyone a minimum amount of bandwidth.

Anyways, the point of this and a few extra posts will be to document my progress and how I’ve done it all so far.

 

Part 1

Ok, first things first I’m doing all this on an old 400 MHz machine running Gentoo Linux. There are two NICs etc etc you know the usual setup.

 

Once the system is installed you’ll need the following packages for basic NAT and firewalling

  • Iptables
  • Shorewall

     

That’s about it – an “emerge shorewall” should install both of these and anything else that’s needed. I’ve also installed Webmin to make my life easier for configuring a few things. Shorewall in particular is nice and easy to setup there. Just make sure Masq is setup and that your interfaces are there and assigned to the correct zones. Set the defauly policy to ACCEPT all traffic (we can make it more secure late) and away we go.

Next we need a DHCP server to run on the internal interface “emerge dhcp” will install one for us. Edit /etc/dhcp/dhcp.conf.sample to your liking and save it to /etc/dhcp/dhcp.conf . Also edit /etc/conf.d/dhcpd and set the listen interface to your internal interface – In my case eth1. Next, start up dhcpd (/etc/init.d/dhcpd start) and check for any errors. It’s a good idea to have a System logger installed for this bit (as I discovered).

 

 

So, next task is to connect it all up physically and test that is does in fact deal out DHCP addresses and you can still access the internet. Assuming it all works, then say hurray. If it doesn’t, then there are plenty more comprehensive tutorials to guide you through the process.

 

 

So…that’s about as far as I’ve got so far. In the next few posts I’ll be detailing the process of Traffic Shaping and probably setting up a DNS server….maybe.

Internet at last!! Hurray

By , September 21, 2007 5:34 pm

Well, it’s been about 3 months and I finally have internet at my new house (!). It’s been an absolute mission trying to get hold of BT to get the phone line. I would suggest anyone avoid BT if at all possible. They are a nightmare to deal with. After about a month that was sorted, and then there arose several issues with our landlord not paying his mortgage, and the house being repossessed and then it not being repossessed anymore and it all being a horrible mistake. Again, a nightmare. But it’s all gravy now and everything is as it was when we moved in. Except that the fridge freezer doesn’t work, the Boiler is stuck at maximum and actually boils our water….on the upside, we have Sky for TV and internet. Who happen to be much easier to deal with than BT could ever hope to be.

 

In other news, Me and Charlotte have survived each other for 11 months now and had ourselves a little summer holiday last week in London. We seemed to get the only good week of weather this year, so we we’re happy. I took lots (read: over 300) photos with my shiny new Digital Camera – A FujiFilm Finepix S5700, more on that in another post. All those photos are in the Gallery under Holidays.

Over the two days we were there we attempted to “do London properly” and see the sights etc. We sort of got there. We:

  • Saw Les Miserables
  • Did The Eye and River Cruise
  • Went to the IMAX Cinemas in the Science Museum
  • Went to The Aquarium
  • Went shopping!
  • Walked a lot

Umm…think that’s about it. Either way we did a lot and were knackered by the time we got back to York.

 

So yeah, that’s pretty much been my last 3 months. Full time work, interrupted but annoyances like BT, and House problems and nicer things like Sky and Holidays.

Panorama Theme by Themocracy