Thursday, May 27, 2010

Blog Move

Hello all,

I recently purchased a domain for the purposes including combining all of my blogs into one website with single styling and more control over how everything works (wordpress plugins here we come!). Shameless plugs for myself aside, it's a pretty handy site. All that being said, all of my posts from my blogs here on blogspot (Musings of a Systems Admin, Musings of a Web Developer, and Musings of a Sub-par Linux User) have been moved to http://www.aaronwball.com.
The website is still being worked on, so the styles might change a bit between now and whenever I decide to stop writing css. Please leave your comments and suggestions.

Thanks for reading everyone!

Monday, May 3, 2010

Ubuntu Bridging Network Interfaces

Hello fellow sys admins,

I have recently been struggling with configuring an Ubuntu server to allow bridging network interfaces. I had one working long ago on another test machine, but it was overwritten with a new install. That being said, for quite some time today I researched this and never really found an answer. I did however find a few websites that eluded to possible methods for doing this. After piecing said methods together, I managed to bridge four Ethernet ports together.

All that being said, 
Here's what exactly I needed to do...
I have four ethernet ports on this awesome quad core xeon processor (hehe...I have to brag a little bit at least) powered server. One port plugs into the switch and provides the box with access to the interwebz. Another port goes to another server, supposing to bring the int3rw3bz to that box as well. The third port goes to a wireless router, providing wireless access to the 1nt3rw3bz. 
Let's see how poor my spelling of 1nt3rw3bz can get by the end of this...

Here are the assumptions for the following example...
You have at least two network adapters. In this case I have four Ethernet adapters. This post will be working with those four.

Here's how I did it...
Run
sudo apt-get update
to make sure that all of your repositories know of the latest software.

After that, run
sudo apt-get install bridge-utils
This will install the necessary software to seamlessly bridge network interfaces.

Now...

Using your favorite text editor, crack open /etc/network/interfaces
sudo nano /etc/network/interfaces
If you haven't done any manual customization of network interfaces yet, you should see something like...
auto lo
iface lo inet loopback
After this entry, type in
auto
iface inet dhcp
bridge_ports <interface> <interface> <interface>

I for my specific situation, I used...
auto br0 (or auto <bridgename>)
iface br0 inet dhcp
bridge_ports eth3 eth0 eth1 eth2

After that, type 
sudo /etc/init.d/networking restart

... and that will bring online your bridge along with all the bridged ports.

If you need your box to have a statically assigned ip address, don't assign it to the interface with the physical internet connection (in my case, eth3). Instead, assign it to the bridge itself.
In a situation like mine, your bridge interface would look like...
auto br0
iface br0 inet static
address 10.0.1.185
netmask 255.255.255.0
network 10.0.1.0
broadcast 10.0.1.255
gateway 10.0.1.1
bridge_ports eth3 eth0 eth1 eth2

There you have it. A network bridge between as many interfaces as you want (or at least the four I tested it with). This of course will work with wireless interfaces as well, such as bridging an ethernet port to a wireless connection, essentially allowing a machine physically connected to a computer with wireless to not have to physically be connected to a wireless router (internet comes in through the wireless card and piped through to the ethernet port).

Happy bridging everyone!



Wednesday, April 28, 2010

Windows Vista/7 445 Port Auto-bind

Hello again all,

If you all haven't noticed, I retitled the blog to be Musings of a Systems Admin. I figure I have enough to write about systems administration (rather than just server related admin) that I needed a place to write without starting a new blog. That being said, welcome to Musings of a Systems Admin!

I have recently set up our primary internal firewall to accept connections only through port 22 to force all remote connections to be initialized through an encrypted ssh tunnel... a good idea to start at least.
At the beginning, everything worked nicely connecting from my remote Linux (Ubuntu) machine. I then proceeded to connect a Windows Vista and a Windows 7 machine with putty. Unfortunately no dice with both.

Here's the exact problem. I created the tunnel for port 445 (localhost:445 destination:445) and connected. SSH connected fine but trying to access the localhost fileshare resulted in a timeout/network device could not be found.

I searched the internet for several hours trying to find a solution to the problem (or even any info as to why it wasn't working when it should) and finally stumbled upon a Microsoft technet forum talking about my exact issue.

The cause of the problem is that in Windows Vista and Windows 7 (as well as Windows XP SP3), Microsoft has auto-bound ports 445 and 139, even when file sharing services are turned off. This is why you can't create an ssh tunnel; because the port is already in use.

The solution. After reading and trying each suggested solution to no avail, I finally stumbled upon a link to a program someone coded to remedy the situation. To my knowledge this works on every operating system (though I've only tested it on Vista and 7).

Enjoy the fix everyone and happy tunneling!

Wednesday, November 18, 2009

Changing the Hostname on a Linux Box

I recently had need to change a server name due to a change in our server naming scheme (local ski resorts to breweries). For the simple comedy of the naming scheme switch, here's how it currently looks (without server prefixes for security purposes of course). If you just want the solution, skip down a paragraph.

Our current environment is mostly virtualized. The hosts are named after breweries and their virtual guests are named after the beers that each brewery produces. Clever, yeah? I can already feel my morale rising.

Now, to the solution...
Changing the hostname on a Linux machine is a bit more complicated than it is in windows.




First off, open up a terminal window













Then type sudo nano /etc/hostname










The file that comes up should contain nothing but a hostname. In my case this is hal8000 (yes, laugh all you want). Change this to whatever hostname you want. Once you have input this, press Ctrl + x. From there press y and Enter. (Ctrl + x closes the file, y says to save the file before closing, Enter saves the file under the original filename).





Once you've done this, all you need to do is restart your computer and you should be golden.



***NOTE***
While the method I just described will change the actual hostname of the computer, its IP address will no longer resolve to its hostname.

Here's how we fix the aforementioned issue.

If you've closed your terminal for the restart, open it up again.
Type sudo nano /etc/hosts



At the top you should see 127.0.0.1, 127.0.1.1 and their associated 'hostnames'. The one to the right of 127.0.1.1 should show your old hostname. Change that to the new hostname and save the file (Press Ctrl + x -> y -> Enter). Now your computer's IP address should resolve to its new hostname.


Enjoy!

Now for a cup of joe...

Thursday, November 12, 2009

Blog Resurrection

Hello all,

A few months back I moved jobs. At my last job (as you all well know from this blog), I was a server administrator and .Net programmer on the side. At the new job, I was hired primarily as a web developer (PHP, JavaScript, Joomla dev, etc.). Naturally, because of the position change, I was no longer doing server administration and consequentially had nothing new to post on this blog.

That has changed now. The company I now work for didn't have much of a server infrastructure (a non-server edition mac that stored files), so they asked me to design and build a new one.

All that being said, I now have new content to post here. You Linux users will be happy to hear that I am now using Linux for some of our servers (virtual host and file server). To you Windows users, I will be building an Exchange server, terminal server, and a backup server (this might be done on Linux though). Most likely things in that list will be shifted around a bit in the next two or so weeks so please bare with me.

Some of the technologies I will be using in the upcoming posts will be
Windows Small Business Server 2008 (x64)
Ubuntu Server 9.10
VMWare Server 2
Microsoft Outlook Exchange
TightVNC
SSH

On one final note, I would like to put out a shameless plug for my other blog, Musings of a Web Developer. It covers the issues and fixes I have found throughout my adventures of coding websites. Essentially, it's the same thing as this blog but for web development rather than server administration.

I look forward to the upcoming comments about how depressing IT work can be *AHEM*... I, uh, I mean the joys of IT work. Who's kidding though. Everyone knows that we IT people love our jobs, especially the Dilbert comics that document our endeavors.

:P