# Home Linux Server

## shagrat

I have a old Pentium Celeron 633 Box and wanted to set it up as some sort of server. I want to be able to share my new 3MB cable connection among my familys 4 Windows and 2 Linux machines. Printer sharing would also be great and the box would also have to function as a file server for both the Linux and Windows boxes. But I don't know where to start. What should I run? Samba? Please help me here, and if you have some links to actual home server "projects" that would also be great. Thanks in advance.

----------

## syko

Unfortunately, I can't offer a whole lot of help, since I'm far from being a guru, but my setup is this:

2 Windows desktops, 1 Linux desktop and a Linux gateway/router. 

For the internet sharing I just use NAT/IP Masquerading (I followed this pretty closely, although it is a bit outdated, and you'd have to adjust for a gentoo install (do you want to use gentoo?)) and an iptables firewall script. The iptables website is a good place to start researching a firewall/router type of setup - specifically the Documentation section with things like "What is iptables?"

For file sharing I use a pretty basic Samba file/print sharing network. I don't recall where I learned about Samba at the moment.

If you haven't already, it might be worth it to do a quick search of the forums for things like NAT, IP Masq, iptables, or Samba. I'm not sure exactly what you'll get, but it might be a good jumping off point.

Like I said, sorry I couldn't be much more help, but I am extremely tired, I set up my little router box quite some time ago, and a lot of the documentation I used I found with google, and so I've since lost it. HTH

----------

## shagrat

Thanks, reading some of it now.

----------

## smiler.se

Yeap iptables and samba is the way to go  :Smile: 

----------

## shagrat

Read up a bit about IP Masquerading and it's seems that some applications don't work behind this setup. What are your experience with this? Will my brother for example be able to angage in an online game while my other brother is chatting on irc? And what about p2p sharing and downloading?

----------

## zhenlin

For TCP, install a SOCKS proxy. For UDP, use forced-routing.

----------

## robostac

Most things work behind MASQ. Theres no way you'll really be able to share (unless your isp gives you multiple ip's) without doing MASQ. Most online games will work, and all can be made to work with a bit of fiddling. Hosting Servers won't generally work, unless you do it on the gateway. Peer2Peer will work, in passive mode. IRC works fine (No dcc without fiddling).

----------

## shagrat

 *robostac wrote:*   

> Most things work behind MASQ. Theres no way you'll really be able to share (unless your isp gives you multiple ip's) without doing MASQ. Most online games will work, and all can be made to work with a bit of fiddling. Hosting Servers won't generally work, unless you do it on the gateway. Peer2Peer will work, in passive mode. IRC works fine (No dcc without fiddling).

 

I don't have multiple IP's, in fact I have a random IP now. But I can get a static IP for some extra $$. Is it worth it?

----------

## ClausH

 *shagrat wrote:*   

> I don't have multiple IP's, in fact I have a random IP now. But I can get a static IP for some extra $$. Is it worth it?

 

Well i dont think a static ip would make much of a difference on your internal network, no if you are going to use ip masq. 

As for the gaming, i set up such a server at my parents house, so i could emerge stuff wile my litlle brother were playing counter-strike. The problem, i belive, with most online games, is that they need a very low latency. fx with the 256kbit/s line at my parents, a 5kbyte/s download would give a ping of more than 1000 in cs, i do not know if this is how it is in general, or a problem with the isp. So what i did was i set up som queing disciplines, effectively cutting the bandwith for download in half, giveing it lowest priority, and cs highest. One should notice though, that cs doesnt need the excess bandwith(i havent testet, but i know that 100kbit/s i more that enough), so one should also put ssh and such traffic in the same queue.

see www.lartc.org

----------

## masseya

Moving from Off The Wall.

----------

## wishkah

About that static ip-stuff: It's prolly not worth it. You might wanna give www.dyndns.org a shot. You get a free hostname, all you gotta do is update it whenever your ip changes (e.g. somewhere.dyndns.org) from your server. Check out their homepage, there are plenty of (linux) tools for this purpose.

I wrote a little script that does the updating only if the ip really changed (that's critical, update 3-4 times without necessity and you'll get banned). This one uses ez-ipupdate, which is one of the said update-tools. Just put the script into crontab:

```

export MYCURIP=`/sbin/ifconfig | grep P-t-P: | cut -f2 -d: | cut -f1 -d' '` 

export MYOLDIP=`/bin/cat ~/oldip`

if [ "$MYCURIP" == "" ]

then

   /bin/echo "Something went wrong while getting current ip, its empty."

else

   /bin/echo "Old IP: $MYOLDIP"

   /bin/echo "Cur IP: $MYCURIP"

   if [ "$MYCURIP" != "$MYOLDIP" ]

   then

      /bin/echo "$MYCURIP" > ~/oldip

      /bin/echo "Updating ip-address."

      /usr/bin/ez-ipupdate -i ppp0 -N root --period 300 -s members.dyndns.org -S dyndns -h HOSTNAME.dyndns.org -u USERNAME:PASSWORD

   else

      /bin/echo "Not updating ip-address."

   fi

fi

```

----------

## syko

 *shagrat wrote:*   

> Read up a bit about IP Masquerading and it's seems that some applications don't work behind this setup. What are your experience with this? Will my brother for example be able to angage in an online game while my other brother is chatting on irc? And what about p2p sharing and downloading?

 

My personal experience with the Masq setup has been pretty positive - I've yet to run into any sort of problems with programs not working. However, I don't do much online gaming. p2p, irc, im all work fine as long as everything is set up the way it should be. I don't know much about what kind of latency you could expect with online games, though.

----------

## taskara

if u don't wanna install gentoo, something like clark connect will do what u are looking for and more..

----------

## stonent

I really like clark connect as a server distro.  I run it as a firewall on my home network. All versions are based off of Redhat releases so you could install apt-rpm or use Redhat's up2date utility. Plus it has a nice web based admin tool similar to many Internet Appliances for firewall, mail, port forwarding, proxy, snort, snortsnarf, samba, ftp... etc..

----------

## shagrat

 *taskara wrote:*   

> if u don't wanna install gentoo, something like clark connect will do what u are looking for and more..

 

Downloading it now, looks very promesing

----------

## endu

for IRC DCC sends, FTP active modes and some other stuff behind NAT, read about connection tracking with iptables. most games are designed to work behind NAT, so this should be no problem.

----------

## Sieg

I have a setup behind a firewall/gateway that works fine. The router/fw is an Astaro box (great if you have one system to dedicate as a router and firewall), and 2 linux servers, 1 windows server and 2 windows workstations behind it. All hosting works great, the only difference is that you have to do explicit port nat on all services that are hosted behind the firewall/router. In your case, it would be the same for services behind, but you would not need to for the services that you would run from within your router/firewall. As far as P2P, IRC (with DCC), etc goes, sometimes you'll have to, once again, do explicit port nat translations in your gateway. This means that this service will be restricted to that particular system in your network. It can be a pain, but works for me. As far as gaming goes, unless you want to host a server, you should never have a problem connecting to outside games from within your network. There is not one game for which I had to do that so far. The only gaming related software that did need that is voice communication, like battlecom, roger wilco or teamspeak.

----------

