Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 5th September 2011, 02:06
tdurham tdurham is offline
Junior Member
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ? Can't determine specific details for static IP setup

Please read this carefully before assuming that I have not researched this for days on end. I have a dedicated "cloud" server from 1and1 and I have loaded Debian lenny 64 on it. I have bricked it almost 10 times trying to set the static IP info for the server. I can't figure out what I am doing wrong. This is "pre-imaged" server. There are 100's of samples on how to fill out the /etc/network/interfaces file but they are ALWAYS for local (or similar IP's. They NEVER tell a non programmer how to determine what the values should be. So here is what I do each time after the re-image.

I install all my updates and I am installing Nginx instead of Apache. I have 6 ips assigned to this server. (I changed my IP's for this example).

Main Server IP:
Additional IP's : thru

Step 1: vim /etc/hosts localhost.localdomain localhost u15761234.onlinehome-server.com u15761234 default-domain.com

(I do not add anything to this file. I am not setting up the Virtual Servers right now. I just want to change it from DHCP to static.

Step 2: vim /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
iface eth0 inet dhcp


Then I run # netstat -nr

u15761234:~# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface UH 0 0 0 eth0 UG 0 0 0 eth0


I then edit my Primary Network Interface to be this:

# The primary network interface
auto eth0
iface eth0 inet static
gateway (I am just using value from above)
network (this is what I have no idea what it should be???
broadcast (I know this is optional).

Should I specify a DNS server here?


Then I run # /etc/init.d/networking restart

I loose my SSH connection and server is non reachable and can't be restarted from the 1and1 control panel. I have to re-image and start all over again.

Any help will be greatly appreciated.
1. What files have to be updated to change it to a static IP setup and not run DHCP (only /etc/hosts and /etc/network/interfaces ??? )

2. How do I determine the proper value to put in NETWORK entry?

3. Do I used the Gateway value from where I ran netstat -nr

4. Is there a way to do this so that IF a person screws something up (like I have done 10 times trying), that it will have a "fall back network config" to roll over to and still boot up.

Thanks for all of your help!!!

Tim D
Reply With Quote
Sponsored Links
Old 5th September 2011, 03:41
mentes mentes is offline
Senior Member
Join Date: Aug 2011
Location: Spain
Posts: 132
Thanks: 4
Thanked 15 Times in 13 Posts

This is the whole /etc/network/interfaces that you need in your server.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	gateway --> This is the output of your netstat -nr 
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers --> These are google nameservers, you can use others
	dns-search yourdomain.com
auto eth0:1
iface eth0:1 inet static
auto eth0:2
iface eth0:2 inet static
auto eth0:3
iface eth0:3 inet static
auto eth0:4
iface eth0:4 inet static
auto eth0:5
iface eth0:5 inet static
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use a certan setup cruz HOWTO-Related Questions 1 9th November 2010 17:48
active-active ha mailserver setup ispcomm Installation/Configuration 8 22nd August 2010 19:24
ISPconfig setup - DNS, router and general access problems ingvar Installation/Configuration 6 31st July 2010 14:13
Chrome + Ubuntu + Flash player andor Desktop Operation 1 25th May 2010 17:59
Debian perfect setup network problem reddogg Installation/Configuration 2 18th January 2006 23:04

All times are GMT +2. The time now is 04:08.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.