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!