Beginning of a journey...

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
Anubis08
Forum Newbie
Posts: 4
Joined: Thu Jul 31, 2008 3:45 pm

Beginning of a journey...

Post by Anubis08 »

Hello All,

This is my very first post in this forum and also my very first post on this journey I'm going to embark upon.

For many years I have been a windows developer primariliy as a database and web programmer but recently moved into software programming; however I've hit a dead end...

For some time I have wanted to program a network gateway, initially I wanted to do it just for fun, but now the company I work for is moving into internet provision and I see the idea's I had for a gateway something that would suit what they wanted.

So I'm embarking on a journey to reach my goal and develop an internet gateway, but not using the windows platform but rather using linux; the problem is, I have no idea where to start. My experience with linux is very limited (I can install a linux distro and get basic functionality running but that's about the end of it).

From what I've been able to glean so far, I'm going to need to program in C++ and be able to modify the linux version of the ip stack. I'll list below the features that I'm wanting to program into the gateway.

My hope is that someone on this board will be able to give me some starting points, url's or examples that might get me going.

A big thanks in advance for any help you can offer.
Anubis.


Ideal Features:

- Act as internet gateway for private lan clients on a public wan
- Handle one WAN interface and up to 8 LAN interfaces with internal routing
- Translate private NAT addresses to public WAN and vice-versa
- Control the clients upload and download bandwidth (optionally with burstablility)
- Control the clients upload and download volume (optionally with bandwidth limit reduction once exceeded)
- Control the clients connectivity based on time
- Authenticate clients by MAC address, IP address, by a 'built-in' web redirection authentication or by PPPoE
- Include a basic QoS to prioritise HTTP/HTTPS over torrents for example.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Beginning of a journey...

Post by VladSun »

I'll give you some directions and man pages. If you have difficulties implementing it, ask again :)
Anubis08 wrote:- Act as Internet gateway for private lan clients on a public wan
Handle one WAN interface and up to 8 LAN interfaces with internal routing

Code: Select all

man ifconfig
man route
Anubis08 wrote:- - Translate private NAT addresses to public WAN and vice-versa

Code: Select all

man iptables
Search for SNAT target.
Anubis08 wrote:- Control the clients upload and download bandwidth (optionally with burstablility)
- Control the clients upload and download volume (optionally with bandwidth limit reduction once exceeded)

Code: Select all

man tc
Well, it's quite a huge manual. I suggest you to use some ready-to-use scripts.
I've written one: http://openfmi.net/frs/?group_id=187
It's for managing access and bandwidth control over several C-class subnets.
Anubis08 wrote:- Control the clients connectivity based on time

Code: Select all

man iptables
Search for time match.
Anubis08 wrote:- Authenticate clients by MAC address, IP address, by a 'built-in' web redirection authentication or by PPPoE

Code: Select all

man iptables
Search for mac match.

or

Code: Select all

man ipset
Or just install a PPPoE server - google it.

Anubis08 wrote:- Include a basic QoS to prioritise HTTP/HTTPS over torrents for example.
The "tc" tool has everything to do whatever QoS you need.
There are 10 types of people in this world, those who understand binary and those who don't
Anubis08
Forum Newbie
Posts: 4
Joined: Thu Jul 31, 2008 3:45 pm

Re: Beginning of a journey...

Post by Anubis08 »

Hello VladSun,

Thank you for the prompt reply. Do you have any recommendation of which linux distro to start from? I am currently using Ubuntu server 8.0 to host a provider built pay-tv service but this only required me to install ubuntu and install the service and start it.

I have also tried to install Ubuntu desktop 7.0 on my laptop but had great difficulty getting my wireless lan active.

To view the man's you gave, do I need the server edition or the client?

Thank very much for your help, I'm quite excited to be getting into this finally!
Anubis.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Beginning of a journey...

Post by VladSun »

For this type of server (i.e. router/traffic shaper) a lot of people recommend using *BSD.
But I've never worked with *BSD OS.

I would advice you to use Slackware (because you'll need patched kernels, iptables, etc.), but it's not so user friendly, as Debian and Ubuntu are. And you are a new to Linux ...

So, maybe it would be best to use Debian (without anything but the core system).

To view the man pages, you don't need a Linux distro - use google. E.g.: man page iptables
:)

Good luck and welcome to Linux world :)
There are 10 types of people in this world, those who understand binary and those who don't
Anubis08
Forum Newbie
Posts: 4
Joined: Thu Jul 31, 2008 3:45 pm

Re: Beginning of a journey...

Post by Anubis08 »

Hello VladSun,

Thank you again very much, you've been extremly helpful! I'm sure it'll take me a few days to pour over the information but this is a great start.

Thanks
Anubis.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Beginning of a journey...

Post by VladSun »

I'm pretty sure you'll have some questions and I'll be happy to help you solving them. I do love LARTC :P

By the way - google for "LARTC" also ;)
There are 10 types of people in this world, those who understand binary and those who don't
Anubis08
Forum Newbie
Posts: 4
Joined: Thu Jul 31, 2008 3:45 pm

Re: Beginning of a journey...

Post by Anubis08 »

Hello VladSun,

I've been reviewing the information and I've managed to locate most of the manuals, but I cannot find a complete 'tc' manual. Do you know where I could get a complete manual (aside from inside linux)?

Also, you've mentioned about the PPPoE to install another server, could you clarify this or give more info?

Thanks
Anubis.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Beginning of a journey...

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply