0844 244 8080

How to Change Which Network Card (eth0 vs. eth1 etc.) Your Ubuntu Server Uses

by Paul Freeman-Powell

Share |

Or, "How To Fix Your Ubuntu Linux Server When You Can't For The Life of You Figure Out Why The Flip It Won't Ping or Talk to the Internet...."

Imagine the scenario: you've just completed a shiny new installation of Ubuntu Server on your HP DL380 G5 machine, ready to take on the world with whatever new and inventive web application you're about to launch. You're just about to drive to Lapland to plonk your server next door to Facebook's new datacentre, when you stumble across a problem. It doesn't work.

What could be causing this? The IP settings are all correct, DNS server is live, gateway correct.... but sudo apt-get update just fails, and an attempt to ping a working web site gets nowhere, not even a resolution of its IP address. Perhaps you were mid-coffee-sip when the installation detected your network ports and has assigned eth0 to that extra network card you've put in to use for a DMZ or other connection? So you've been into the etc/network/interfaces file and updated it, and restarted networking, but still to no avail?

Well, this very scenaraio happened to a guy I know just this week. He shall remain nameless, but he did a lot of Googling around and finally found a solution which worked. Ubuntu Server has some useful security defaults which protect you from accidentally giving all your data to the bad guys - which is clearly a good thing. They may also have shares in coffee manufacturers due to the amount that gets drunk whilst fixing problems ("learning"), but that's a different issue. So when you change to use a different network card, it sees that this has a different MAC address from the first one, and it deliberately doesn't make any assumptions about its configuration which would end up placing your data on the wrong side of your firewall.

So, to clear out its previous configuration and let it reconfigure for your new card, delete the configuration file by running this command:

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Then, reboot your server and - hey presto! - it should all work. At least, this is what I did and it worked for me (errr... I mean the guy I know. The one who remained nameless) and credit goes to the fellas in the forum linked above.

We're all still learning every day (most of all me) so if you're reading this and thinking "what on earth is this guy on about?" then please correct me and share the knowledge in the comments section below!



Share |
Paul Freeman-Powell

Paul Freeman-Powell is a technology, software and hardware enthusiast. He founded and owns caeus.com Ltd. and works as a web developer, IT consultant and computer repair technician. In his spare time, he speaks French and Spanish fluently and is also a keen drummer and photographer (but not at the same time). His personal web site can be found at www.paulfp.net.

 

Your Comments

CAPTCHA Authorisation Code

Comments are publicly viewable so please don't include any personal data such as your phone number or email address. Submitting a comment indicates acceptance of our Terms & Conditions.

1. At 19:41 on 11 Feb 2012 Aziz wrote:

Thanks alot!This was exletcay what I needed to install java on my server (Sry for bad english, I am from Norway )

2. At 03:06 on 8 Mar 2012 Jimbo wrote:

1.What types of things did the first website ask you to do?The website tells us to read a reversed paragraph in 60 seconds.2.On a scale of 1- 10 how successful were you in completing the tasks? 73.What made completing the task difficult?The letters were reversed, but I made out the words little by little.4.What could the web designer have done to make the site more accessible to you?They made it helpful by informing me of the reversed speech.1.What types of things did the first website ask you to do?It asked me to multi-task.2.On a scale of 1- 10 how successful were you in completing the tasks? 73.What made completing the task difficult?Doing two things at the same time.4.What could the web designer have done to make the site more accessible to you?They could have made it less difficult.

3. At 05:31 on 8 Mar 2012 Brandi wrote:

Once I received a call offering me a decent sum to turn for a pianist for a chamber music concert. I was pleased to finally get paid for something I'd been doing pro bono for years. I got there early and met with the pianist. He seemed high-strung but some people are before a concert. I clarified repeat issues with him and he assured me he was a clear nodder.The concert began and I soon saw why he was so high-strung; his mediocre technique and limited musicality made him a bad choice to play the well-known Beethoven and Brahms trios he was tackling (almost literally, football player style). We got towards the end of the first page and he did not nod. I figured, Maybe he likes memorize the beginning of the next page and have late turns. Nope as we reached the last two beats he abruptly turned his heard toward me and, in a low, gruff voice barked, Turn! This disagreeable ritual was repeated for most of the performance. I thought it might have been less disruptive for him and the audience to nod as he said. No such luck. I made it through and didn't mess it up, but he really unnerved me and I dare say I was very deserving of my pay that evening.

4. At 13:17 on 14 May 2012 Stationary Design Service wrote:

I really hate when my time is trashed by some unimportant element in the web business sphere. But these guys provided me the optimum utilization of my time by offers me what I want in a very short time frame which helped me in building so many new clients. Thank you.

5. At 13:18 on 14 May 2012 Website Design Service wrote:

I was roaming around in search of same particular service. and yeah I am finally landed on a right spot. The dealing is out of the box and coordination is outstanding. I must share this so other companies should also be benefited through this. Lot of Applaud for you guys.

Copyright © caeus.com Ltd. 2011. This article and all its contents are the property of caeus.com Limited and are protected by copyright. You may not distribute, modify, transmit, reuse, repost, or use the content of this article for public or commercial purposes (including text and images) without written permission from caeus.com Limited. The views expressed in this article and sites linked to herein are solely those of the author or individual(s) providing them and do not reflect the opinions of caeus.com Ltd., its parents, affiliates or subsidies. Any trademarks and brands mentioned in this article are the property of their respective owners and their use does not imply any affiliation with, or endorsement by, caeus.com Limited. The content of this article is provided in good faith and for information purposes only; you follow any advice given entirely at your own risk and no responsibility can be taken for any consequences which may arise as a result of following advice given in this article.

Articles & How-To Guides


Sign up to caeus.com
Secure Data Destruction... click here

 

Connect With Us:

Valid CSS! Valid XHTML 1.1!