View Full Version : Linux box as a router, firewall, DNS, NAT..and you name it!
venom
Greetings everyone! I'm new here and this is my first post. It's nice to finally find a friendly place to discuss technology issues with fellow Egyptians. Recently I decided it was about time I got a taste of broadband, especially now that prices of DSL in Egypt have finally dropped to an almost affordable level. I live in a 10-storey residential building, and in order to get maximum cost effectiveness, I thought it would be best to get a highspeed DSL connection and set up a little LAN to share it with a number of my neighbors, and.. you guessed it. Nothing better than a Linux box to be the little LAN's frontend to the outside world, switching packets, fairly dividing the bandwidth between nodes, and protecting poor unsuspectable M$ WinXP users from stray packets coming from the Cyberspace.
Since I'm no-professional, merely an enthusiast, and this being my first Linux server project, I thought I'd turn to you guys for advice. Any ideas/tips/personal experiences with similar setups would be more than nice. Also, I have a few specific questions:
First of all, any advice regarding which ISP to choose? I've done some research, and MenaNet seem to have the best prices. No idea about quality though. They offer 2Mbps ADSL for a little over 1k/month, which when shared by, say, 8 subscribers would mean each one would get 256kbps at around LE135/month. Note that this would normally cost well over LE300/month. Not bad huh? However, whether they *really* deliver that 2Mbps they promise remains to be seen. By the way, I live in Nasr City, around 3 km from the nearest PO.
Second, I know that Linux is legacy-hardware friendly.Would an old Pentium 166MHz with 64MB of RAM (which I happen to have lying around) suffice? Or maybe that won't quite cut it? It'd sure be nice though, since I woudn't have to buy a new PC.
Third, since I will be sharing a 2Mbps bandwidth anyway, there's no need to use 100Base Ethernet. Good ol' 10Mbps would more than suffice, plus I get to use coaxial cable and avoid the need for an expensive hub/switch. What do you guys think? And any idea where to get a bunch of old second hand coax NICs?
Well, that's about all. Any thoughts are welcome.
Thanks!
RedHat
You will are trying to say :
I am gonna get a BMW motor, and try to fit in a FIAT 128 body, will that work?
If you going to for coax , and 10 hubs you will have a lot of latency , adding delays, and you gonna have fun fixing the network from time to time, talking about proper termnations ... etc . Drop that coax idea !!!!
get a switch not a hub.
It is going to be one time setup man, do not go that cheap, otherwise do not bother to get the 2MB link.
angoranimi
yes, that box would definitely suffice.
as Redhat pointed out, forget about coax... you can get a hub for a really cheap price. most affordable switches are a combination of hubs (for example, every 4 ports are shared as if they are connected together to a hub, but they are connected to a dedicated link with the next 4), so you might even try to find you a cheap switch.
Unless you're going to be running apps which consume the local bandwidth (say, setup a local quake 3 network game), 10 Mbps should more suffice as well (assuming there are max 8).
ShErbO
Originally posted by venom
What do you guys think? And any idea where to get a bunch of old second hand coax NICs?
But why second-hand NICs ?? They are already cheap !!
The Genius ones cost 65 LE & they can run 10/100 MBps..
alaa
realtek nics for 30LEs works fine so far.
cheers,
Alaa
ShErbO
Even better, 30 LE a piece :)
btw, alaa do these cheapies work under linux ?
venom
Thanks for the responses mates. The reason I asked where to find second hand cards is that I was thinking about using coax, and they don't make NICs with these anymore. But if that's gonna cause me trouble, I think I'd rather purchase a switch and so be it. Peace of mind is good :)
Alaa those Realteks are new for LE30 a piece? WOW! How about a nice 8-port switch? any idea how much that would cost?
I still haven't got any input regarding the ISP question. Come on guys.. None of you has DSL yet?
Cheers,
venom
sattia
Im not going to add too much or at all; the gurus here did it.
But Im going to discuss one thing only; the 2Mb link u r going to buy.
I think 2Mb for 10 or even 20 persons is too high. A 512 Mb is sufficient. You are not going to download all ur time nor anyone else.
It is better to buy what u need only and dnt buy the best thing in the market; it is a bad marketing habit.
For the ISP part, consider the following:
- Do they lease the CPE or u buy it?
- Is the CPE a router or a USB modem? Not all USBs work well under Linux; check the model/make of the device
- Does the price include the telco fees (40 LE without taxes) or u pay it?
- Do they assign u a quota for download or it is flat rate?
alaa
>Even better, 30 LE a piece
>btw, alaa do these cheapies work under linux ?
Sherbo don't insult me, do I use anything but GNU/Linux??
what did you take me for an Amiga user??
cheers,
Alaa
m0h
Originally posted by sattia
[B]Im not going to add too much or at all; the gurus here did it.
But Im going to discuss one thing only; the 2Mb link u r going to buy.
I think 2Mb for 10 or even 20 persons is too high. A 512 Mb is sufficient. You are not going to download all ur time nor anyone else.
It is better to buy what u need only and dnt buy the best thing in the market; it is a bad marketing habit.
I agree with sattia, I'm sharing a 512 Mb at home with 6 users & It's more then great!
You may also want to check TEData & Link.net
ShErbO
lol.. sorry alaa, no offence intended :)
alaa
512 MEGABITS WOW when did they invent this, or are you guys using some new fiber optics technology??
thats about 64 MegaBytes per second download rate right?? I mean you actually get to download a cd full in ten seconds?!
you must be rich.
venom
Originally posted by sattia
Im not going to add too much or at all; the gurus here did it.
But Im going to discuss one thing only; the 2Mb link u r going to buy.
I think 2Mb for 10 or even 20 persons is too high. A 512 Mb is sufficient. You are not going to download all ur time nor anyone else.
It is better to buy what u need only and dnt buy the best thing in the market; it is a bad marketing habit.
2 Megabits per second for 20 people is too much? Come on man! That means each one gets less than 128kbit/sec! That sucks! It would probably be cheaper to get 128K ISDN then. Bandwidth rulez supreme! And I think I've been stuck with 56k dialup for far too long! Well I don't know about the rest of my neighbors, but are you kidding? OF COURSE I'm gonna be downloading all the time :)
Keep in mind that I'm not paying a royalty or anything, on the contrary: I'm taking advantage of the "quantity discount." I will be offerring each user 256k for a fraction of what they'd pay if they were to get it on their own... PLUS it's even better. Why? with proper bandwidth management, each user will likely get significantly more than this speed since obviously we won't be ALL using the net at the same times all the time
For the ISP part, consider the following:
- Do they lease the CPE or u buy it?
- Is the CPE a router or a USB modem? Not all USBs work well under Linux; check the model/make of the device
- Does the price include the telco fees (40 LE without taxes) or u pay it?
- Do they assign u a quota for download or it is flat rate?
These guys are actually great. The price includes leased equipment (DSL modem & splitter), Telecom Egypt fees, and there are no quotas. However, there's an extra charge if you want a DSL modem with ethernet interface rather than USB. Of course, I'll check to see first whether the hardware works with Linux either way.
venom
Originally posted by m0h
I agree with sattia, I'm sharing a 512 Mb at home with 6 users & It's more then great!
You may also want to check TEData & Link.net
Already checked. Both have higher prices. Would love to hear about the quality though.. Do you really get 512k 24/7? and how far are you from the nearest PO?
ShErbO
Originally posted by venom
However, there's an extra charge if you want a DSL modem with ethernet interface rather than USB. Of course, I'll check to see first whether the hardware works with Linux either way.
If it's got ethernet interface, then it works for linux :)
alaa
you can conserve bandwidth even more with GNU/Linux.
you can run a caching webproxy servers to speed web browsing a bit (doesn't work very well with ultra dynamic pages though).
you can use your proxy server to block ad sites which hog the bandwidth.
you can set up a mail server and a pop server pull everyones mail at regular intervals and serve it to them in the internal network, you conserve bandwidth if you pull mail at times of light traffic.
there are scripts to work with most webmail services.
you can also setup spam and virus filters so you don't have to hog the network with unneeded emails.
you can centralize downloads by setting up a simple app, users send an email with a url and the app would go and download the file placing it in a special ftp directory (you could have one for each user), if you cooperate you can always have just one file downloading at any point in time.
one can work out a similar system for P2P networks by using a decent client like giFT and pushing hashes instead of URLs.
there should be an option to make these files public so that you never need to download the same file twice.
of course you need to be on very good terms with all 20 users for this to work out so this might not be socially practical but still it's cool right.
check this http://lartc.org/wondershaper/ it might be useful.
cheers,
Alaa
sattia
alaa:
I took a while untill I discovered that. I meant surely 512 Kbps but the 512Mbps was a dream ... oops a mistake ;)
venom:
Its up to u but experiments tell what I told u. U may utilise this very high bw on ur first few days no more because its just a new something.
Remember that 1 (one) M (Mega) bps used to be the backbone of one of the major Egyptian ISPs in the past 5 years.
So here is my advice; go for a 512Kbps and measure ur traffic using MRTG for a period of a month or so and then upgrade if needed.
But promise to show or tell us the peaks; at least to help other home users plan their networks.
venom
Originally posted by alaa
you can conserve bandwidth even more with GNU/Linux.
you can run a caching webproxy servers to speed web browsing a bit (doesn't work very well with ultra dynamic pages though).
you can use your proxy server to block ad sites which hog the bandwidth.
Great idea! Although this won't make much difference for me (I will be using the net mostly for downloading MP3s & movies via ftp) I think my neighbors will appreciate their M$ hotmail login pages loading instantly from cache! :)
you can set up a mail server and a pop server pull everyones mail at regular intervals and serve it to them in the internal network, you conserve bandwidth if you pull mail at times of light traffic.
there are scripts to work with most webmail services.
you can also setup spam and virus filters so you don't have to hog the network with unneeded emails.
you can centralize downloads by setting up a simple app, users send an email with a url and the app would go and download the file placing it in a special ftp directory (you could have one for each user), if you cooperate you can always have just one file downloading at any point in time.
one can work out a similar system for P2P networks by using a decent client like giFT and pushing hashes instead of URLs.
there should be an option to make these files public so that you never need to download the same file twice.
Man you're a genius! I never thought of any of this. I'll definitely try to implement at least some of this stuff.
of course you need to be on very good terms with all 20 users for this to work out so this might not be socially practical but still it's cool right.
Uh huh! Now THAT is the most difficult part of the entire project lol.. I'm not so good with this social stuff but I'll do my best I guess :\
Wonderful thoughts man. Thanks a zillion! :)
venom
Remember that 1 (one) M (Mega) bps used to be the backbone of one of the major Egyptian ISPs in the past 5 years.
{/B]
Yeah, and frankly I think that was PATHETIC. No wonder people barely got 3-4kbyte/sec downloads when the 56k dialup is (at least in theory) capable of 7kbytes/sec.
[B]
So here is my advice; go for a 512Kbps and measure ur traffic using MRTG for a period of a month or so and then upgrade if needed.
But promise to show or tell us the peaks; at least to help other home users plan their networks.
Definitely, mate. No matter what I do, I'll keep you guys posted with all the details.
jitter
RJ no coax
switch no hub , i got one for 200 LE , 8 port
and bandwidth is never measured using the divided sign ;)
put a squid server over this box
dont install X there , make it all console based
and a nice iptables firewall(google this :yolinux iptables)
vBulletin v3.0.1, Copyright ©2000-2004, Jelsoft Enterprises Ltd.