Personal computing discussed

Moderators: renee, SecretSquirrel, notfred

 
Inkedsphynx
Gerbil Jedi
Topic Author
Posts: 1514
Joined: Fri Nov 19, 2004 9:57 am
Location: Seattle, WA

*nix noob creating a Gentoo router/server

Sat Aug 07, 2010 12:12 am

So, I'm basically a complete noob when it comes to using Linux. I had a very brief amount of exposure to it over 10 years ago, since then, nada. However, since moving into a new job last month, I find that I need to do some serious learning, as I'm working in a primarily Linux environment.

So, I started putting an idea together in my head. I have a system checked out from work for me to use at home to learn Linux (though I'm likely going to attempt to raid some friend's hardware stashes in order to assemble a system I can permanently keep if this works). Now, for me, I can read books and webpages and man pages all day, but I am not really going to learn anything until I do something. So I started thinking to myself, "What could I do with a Linux system that would actually be something I need?

Browsing around the interwebz, I came across the idea of setting up a Linux box to act as a router/server. Seems like a great way to learn, especially since I know very little about networking in addition to my limited knowledge of Linux.

I chose to use Gentoo as I'd seen a co-worker running it, and doing basically everything through a console as opposed to a GUI. Intuition tells me I'm going to learn a lot more operating on the console level as opposed to relying on a GUI crutch.

So, my goal is to setup and configure a working Gentoo server/router without a GUI or at least with a minimal GUI. I decided to post on here and use this as a thread to track my progress, get tips/hints, ask questions, and generally share my adventure into the world of Linux. Updates may not come to fast, as I don't get much time I can spare to the project, but I'm going to do my best to keep progress up.

So far the project consists of me downloading a Gentoo minimal install .iso and burning it to a cd.

If anyone has any comments or tips/knowledge to share, please feel free to do so at any time.
 
Zoomastigophora
Gerbil Elite
Posts: 667
Joined: Tue Nov 11, 2008 7:10 pm

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 11:48 am

I don't know how much has changed, but last time I worked with Gentoo, I learned that it was always better to do a manual install instead of using the GUI installer on the LiveCD. For some reason, the kernel that genkernel spat out as part of the GUI installer instantly broke the moment I tried to do anything that wasn't configured during the installation. Besides, you'll learn more doing a manual install :)
 
Inkedsphynx
Gerbil Jedi
Topic Author
Posts: 1514
Joined: Fri Nov 19, 2004 9:57 am
Location: Seattle, WA

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 11:53 am

I haven't decided how I want to do the install yet. I did download the minimal install .iso and need to stick it on a CD (just noticed a few minutes ago I stuck it on a DVD by mistake). I'm thinking I might go with that method just to get me up and running and then look into other methods after the fact, so at least I've got something functioning. I'll have to do 2 installs anyway, since I'm going to start with this system I have from work and eventually switch to a system of my own once I can obtain the requisite hardware.
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 4:35 pm

Unfortunately I've got zero experience with Gentoo. All of my Linux explorations to date have been with Redhat/Fedora and Debian/Ubuntu, so I can't give much in the way of Gentoo-specific advice.

How fancy do you want to get? There are some fairly simple Linux firewall tools available -- ufw (command line) or firestarter (GUI), for example. Or you can set up a full-blown, "industrial strength" firewall/router package like shorewall.

You'll need two NICs, of course. So if the PC you're planning to use has only one, your first order of business will be to install and configure a second NIC...
Nostalgia isn't what it used to be.
 
Shining Arcanine
Gerbil Jedi
Posts: 1718
Joined: Wed Jun 11, 2003 11:30 am

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 5:04 pm

Inkedsphynx wrote:
So, I'm basically a complete noob when it comes to using Linux. I had a very brief amount of exposure to it over 10 years ago, since then, nada. However, since moving into a new job last month, I find that I need to do some serious learning, as I'm working in a primarily Linux environment.

So, I started putting an idea together in my head. I have a system checked out from work for me to use at home to learn Linux (though I'm likely going to attempt to raid some friend's hardware stashes in order to assemble a system I can permanently keep if this works). Now, for me, I can read books and webpages and man pages all day, but I am not really going to learn anything until I do something. So I started thinking to myself, "What could I do with a Linux system that would actually be something I need?

Browsing around the interwebz, I came across the idea of setting up a Linux box to act as a router/server. Seems like a great way to learn, especially since I know very little about networking in addition to my limited knowledge of Linux.

I chose to use Gentoo as I'd seen a co-worker running it, and doing basically everything through a console as opposed to a GUI. Intuition tells me I'm going to learn a lot more operating on the console level as opposed to relying on a GUI crutch.

So, my goal is to setup and configure a working Gentoo server/router without a GUI or at least with a minimal GUI. I decided to post on here and use this as a thread to track my progress, get tips/hints, ask questions, and generally share my adventure into the world of Linux. Updates may not come to fast, as I don't get much time I can spare to the project, but I'm going to do my best to keep progress up.

So far the project consists of me downloading a Gentoo minimal install .iso and burning it to a cd.

If anyone has any comments or tips/knowledge to share, please feel free to do so at any time.


You probably should ask this question on the Gentoo Linux forums. You usually will receive more useful information there than you can get at other forums, especially a forum like this, which has an emphasis more on hardware than on software. Fortunately, we have at least two Gentoo users on these forums, one of which is myself. I happened to see your thread from the main page, so I can give you some advice on this matter.

Read the following documents:

http://www.gentoo.org/doc/en/handbook/
http://www.gentoo.org/doc/en/xorg-config.xml
http://www.gentoo.org/doc/en/xfce-config.xml
http://www.gentoo.org/doc/en/home-router-howto.xml

I am suggesting XFCE because you want a minimal GUI. You literally have dozens of other options in this area, with the more popular KDE and GNOME desktop environments being among them.

Zoomastigophora wrote:
I don't know how much has changed, but last time I worked with Gentoo, I learned that it was always better to do a manual install instead of using the GUI installer on the LiveCD. For some reason, the kernel that genkernel spat out as part of the GUI installer instantly broke the moment I tried to do anything that wasn't configured during the installation. Besides, you'll learn more doing a manual install :)


The GUI installer was abandoned for that exact reason. There were too many configurations to support to be able to have it work every time.

Inkedsphynx wrote:
I haven't decided how I want to do the install yet. I did download the minimal install .iso and need to stick it on a CD (just noticed a few minutes ago I stuck it on a DVD by mistake). I'm thinking I might go with that method just to get me up and running and then look into other methods after the fact, so at least I've got something functioning. I'll have to do 2 installs anyway, since I'm going to start with this system I have from work and eventually switch to a system of my own once I can obtain the requisite hardware.


Use System Rescue CD to do the installation. It is a fork of Gentoo Linux that exists exclusively as a LiveCD. Many Gentoo Linux users use it to do Gentoo Linux installations because they find that it is better than the official LiveCD.

http://www.sysresccd.org/Main_Page

If you want to have your second system up and running in a short amount of time and both systems are the same system architecture (e.g. both are amd64), you can configure your system's CFLAGS and CXXFLAGS (which are likely a clone of your CFLAGS) to be optimal for the lowest common denominator of the two systems to which you will install Gentoo Linux and then configure Gentoo's package manager to generate binary packages:

http://www.gentoo.org/doc/en/handbook/h ... #doc_chap4

You will want to do this prior to compiling software on the first system and if you want to make sure all of the binary packages are ready made by the time you install Gentoo Linux on the second system, you will want to run "emerge -eav world" to rebuild all of the software on the system. You could run this overnight. You can also specify the "--jobs" flag to have it build as many packages in parallel as possible. This might cause your system to run out of memory, so you could specify something like "--jobs=n" to limit the number of packages built simultaneously to n. Of course, you would specify a number in place of "n". There is presently a bug in the system package manager that can cause build failures when multiple packages are built simultaneously, so if you do not want to deal with it, you should probably not bother with the "--jobs" flag.

Once the binary packages are built and you are configuring your second system according to the Gentoo manual, you will want to skip the step where you install a portage snapshot and instead copy the contents of /usr/portage/ from your first system to your second system. You will also want to copy over your /var/lib/portage/world file, your /etc/locale.gen file, and if it exists, your /etc/portage/package.use file. You will then want to verify that you have the same global USE flags in /etc/make.conf. You can likely copy your /etc/make.conf file too, but you will want to double check its contents to verify that they are appropriate for your new system. Once you have done that, you can then run "emerge -kave world" to reinstall all of the software that you had on the first system on your second system via binary packages, which are contained in the /usr/portage/packages directory is contained inside of /usr/portage. After all of the binary packages are installed, you can proceed as you did in the guide, but things will be much faster, because all you need to do is manually install your kernel, boot loader and do some basic configuration work.

Keep in mind that after the binary packages are installed, you could delete the contents of /etc/portage/packages/ and also change your system CFLAGS and CXXFLAGS to be more specific to your system. You could then either run "emerge -ave world" overnight to rebuild everything to be "optimal" for your system's processor or you could just let them pass and as you update your system by doing something like "emerge --sync && emerge -avDuN world", the new versions of software will be compiled specifically for your processor. The difference in performance will not be more than 1% to 2% either way, so whatever you do is fine.

Also, you probably should decide with your first system whether you want to use software that is marked stable or marked testing. Gentoo Linux by default installs only software marked stable. Most of the software marked testing is considered stable by upstream and is basically meant to be available to more advanced users before it is cleared for use by the general public. If you want to be on the bleeding edge and do not mind the occasional hiccup, I suggest you go with the testing tree. If you want to get software that has been thoroughly tested by both upstream and downstream, I suggest that you go with the stable tree. It is possible to mix trees (i.e. select specific packages from one tree when your system is configured to use software from another), but that will cause headaches when dealing with upgrades, so I do not recommend doing it. There is documentation on how to do these things in the handbook. Here is the page from the x86 handbook.

By the way, if you want a 64-bit system, you will likely want to use the amd64 handbook, although for intents and purposes, each version of the handbook is essentially the same as long as you know what you are doing.

just brew it! wrote:
Unfortunately I've got zero experience with Gentoo. All of my Linux explorations to date have been with Redhat/Fedora and Debian/Ubuntu, so I can't give much in the way of Gentoo-specific advice.

How fancy do you want to get? There are some fairly simple Linux firewall tools available -- ufw (command line) or firestarter (GUI), for example. Or you can set up a full-blown, "industrial strength" firewall/router package like shorewall.

You'll need two NICs, of course. So if the PC you're planning to use has only one, your first order of business will be to install and configure a second NIC...


Are you not glad that I am here? :P
Disclaimer: I over-analyze everything, so try not to be offended if I over-analyze something you wrote.
 
cubical10
Gerbil First Class
Posts: 184
Joined: Fri Mar 03, 2006 2:52 pm
Location: Montreal

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 8:34 pm

I would suggest that you start with the primary distribution that is used at your workplace as you get the most relevant experience. At the end of the day Linux is Linux, but there are differences in the implementation and philosophies between the various distributions. As an example, package managers all do the same thing (check for dependencies, watch for updates, etc..), but learning the ins and outs of apt-get on a Debian like distribution, will not help you too much with yum on a rpm based distribution like Red Hat/Fedora.

I went thru a similar R&D project last week building an wireless AP using Ubuntu with hostapd and a few simple iptables rules. I plan going deeper in iptables to look some more advanced firewalling, QoS, and may take crack at a captive portal.

My 2 cents...
Cubical 10
I only know enough to be dangerous.

Do ubuntu? pfsense
 
Inkedsphynx
Gerbil Jedi
Topic Author
Posts: 1514
Joined: Fri Nov 19, 2004 9:57 am
Location: Seattle, WA

Re: *nix noob creating a Gentoo router/server

Sat Aug 07, 2010 9:51 pm

Couple of quick things:

One being that I'm not really posting this as a cry for help, it's more of a "I'm tracking my progress, feel free to comment as you'd like" kind of thing.

Secondly, we don't have a primary distro at work. I support end-user servers that run any flavor of Linux the customer wants, and while we primarily don't do software support (most of my job is varying types of hardware support), the knowledge is helpful. I know they're all different (I've got Fedora on my work machine), I chose Gentoo for this system for the above specified reasons.

Anywho, don't really have time at the moment for a more in-depth post, so here's a summary of today:

Got Gentoo installed but I goofed something when I went to put GRUB in the MBR and it didn't work properly, and I'm not sure how to get back to the part I think I boned, so I'm going to start from scratch again. Doesn't really cost me anything but a bit of time, and gives me an arbitrary excuse to go through the install again and help to cement it a bit more in my memory. So I'll probably work on that a bit tomorrow. However, time to go to dinner now, thanks for all the feedback so far guys, and definately thanks for the links and tips, I sincerely appreciate them!
 
Shining Arcanine
Gerbil Jedi
Posts: 1718
Joined: Wed Jun 11, 2003 11:30 am

Re: *nix noob creating a Gentoo router/server

Sat Aug 21, 2010 9:14 pm

Is it possible to get an update on how this went? It has been 2 weeks now.
Disclaimer: I over-analyze everything, so try not to be offended if I over-analyze something you wrote.
 
Inkedsphynx
Gerbil Jedi
Topic Author
Posts: 1514
Joined: Fri Nov 19, 2004 9:57 am
Location: Seattle, WA

Re: *nix noob creating a Gentoo router/server

Fri Sep 17, 2010 9:40 pm

Sorry for the lack of updates, I actually haven't really had a chance to work on it at all, however this weekend I promise to devote some time to it and I will update afterwards. I've been swamped with work... which I'm about to make a different post about!
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: *nix noob creating a Gentoo router/server

Fri Sep 17, 2010 9:45 pm

Inkedsphynx wrote:
Sorry for the lack of updates, I actually haven't really had a chance to work on it at all,

I know how that goes. Finally got around to setting up my own DIY router about a week ago... it's been on my "to do" list for years! :lol:
Nostalgia isn't what it used to be.
 
Shining Arcanine
Gerbil Jedi
Posts: 1718
Joined: Wed Jun 11, 2003 11:30 am

Re: *nix noob creating a Gentoo router/server

Fri Sep 17, 2010 10:04 pm

just brew it! wrote:
Inkedsphynx wrote:
Sorry for the lack of updates, I actually haven't really had a chance to work on it at all,

I know how that goes. Finally got around to setting up my own DIY router about a week ago... it's been on my "to do" list for years! :lol:


It was the same for me with a Linksys WRT54GS v2.1 router that I bricked earlier this year. I managed to get it working about a week ago too.
Disclaimer: I over-analyze everything, so try not to be offended if I over-analyze something you wrote.
 
Dirge
Gerbil Jedi
Posts: 1620
Joined: Thu Feb 19, 2004 3:08 am

Re: *nix noob creating a Gentoo router/server

Sat Sep 18, 2010 10:07 am

just brew it! wrote:
Inkedsphynx wrote:
Sorry for the lack of updates, I actually haven't really had a chance to work on it at all,

I know how that goes. Finally got around to setting up my own DIY router about a week ago... it's been on my "to do" list for years! :lol:


I hope to see updates on your project appearing in a new thread.
FDISK /MBR

Who is online

Users browsing this forum: No registered users and 37 guests
GZIP: On