• Share
  • Sharebar
  • Share

It appears that my trusty debian based server died over the weekend, my motherboard would not do a post at all. After lots of trial and error swapping hardware in and out, I decided it was time to build a new one. Luckily for me I had some spare hardware waiting to be utilised. This is how my first server was born, never throw away old hardware it may come in handy one day!

The new system I just happen to have lying around was made up of an Abit an7 board and an AMD Semprom 2400+. I used the ram out my old machine, along side the existing ram in the new machine. Banking on the hard drives not being corrupt and not being the reason that my old server had died I also attached these to the new machine.

I attached a keyboard and a monitor and powered it up. Hey presto it booted up in no time at all. This might not sound like much of an achievement, but try moving a hard drive with Windows installed on it, into a brand new machine with totally different hardware, go on I dare you!

So I was feeling pleased with myself, having spent only around 30-45 mins without my trusty old server, and I opened putty on my laptop and tried to ssh into my new box. What was wrong? I still couldn’t connect to my server.

Executing the ifconfig command only came back with the loopback interface (lo). I couldn’t understand what was happening, but then I realised I was using a different network adapter, as they are both on board Lan controllers and therefore have different mac addresses. Linux being the clever OS that it is does not want to override your settings for device eth0, just in case you are using two interface cards and would like to use the other one at a later date.

If you execute the following:

ifconfig -a

you should get something like this:

eth1 Link encap:Ethernet HWaddr 00:50:8D:EB:89:7C
inet addr:192.168.0.50 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:8dff:feeb:897c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3258 errors:0 dropped:0 overruns:0 frame:0
TX packets:2780 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4002714 (3.8 MiB) TX bytes:303357 (296.2 KiB)
Interrupt:177 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

This is showing you that your new network card is actually mapping to device eth1. To get your network up and running quickly simply open /etc/network/interfaces or your equivalent if you are not using debian, and replace occurrances of eth0 with eth1 or whatever device ifconfig reported. Then execute the following:

sudo /etc/init.d/networking restart

This will restart the networking daemon and set up eth1 as your new device. If you want to revert it back to eth0, I believe you can remap the mac address of the new card by creating or editing /etc/iftab, but this will suffice for me.