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.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th September 2011, 01: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 192.168.1.1 (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: 211.240.117.1
Additional IP's : 211.240.117.3 thru 211.240.117.7

Step 1: vim /etc/hosts

127.0.0.1 localhost.localdomain localhost
211.240.117.1 u15761234.onlinehome-server.com u15761234
211.240.117.1 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
10.255.255.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
0.0.0.0 10.255.255.1 0.0.0.0 UG 0 0 0 eth0
u15761234:~#

-------------------------------------------------

I then edit my Primary Network Interface to be this:

# The primary network interface
auto eth0
iface eth0 inet static
address 211.240.117.1
gateway 10.255.255.1 (I am just using value from above)
netmask 255.255.255.255
network 192.168.1.0 (this is what I have no idea what it should be???
broadcast 211.240.117.1 (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
  #2  
Old 5th September 2011, 02:41
mentes mentes is offline
Senior Member
 
Join Date: Aug 2011
Location: Spain
Posts: 132
Thanks: 4
Thanked 15 Times in 13 Posts
 
Default

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

Code:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	address 211.240.117.1
	netmask 255.255.255.0
	network 211.240.117.0
	broadcast 211.240.117.255
	gateway 10.255.255.1 --> This is the output of your netstat -nr 
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 8.8.8.8 8.8.4.4 --> These are google nameservers, you can use others
	dns-search yourdomain.com
auto eth0:1
iface eth0:1 inet static
	address 211.240.117.3
	netmask 255.255.255.255
	broadcast 211.240.117.3
auto eth0:2
iface eth0:2 inet static
	address 211.240.117.4
	netmask 255.255.255.255
	broadcast 211.240.117.4
auto eth0:3
iface eth0:3 inet static
	address 211.240.117.5
	netmask 255.255.255.255
	broadcast 211.240.117.5
auto eth0:4
iface eth0:4 inet static
	address 211.240.117.6
	netmask 255.255.255.255
	broadcast 211.240.117.6
auto eth0:5
iface eth0:5 inet static
	address 211.240.117.7
	netmask 255.255.255.255
	broadcast 211.240.117.7
Reply With Quote
Reply

Bookmarks

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 16:48
active-active ha mailserver setup ispcomm Installation/Configuration 8 22nd August 2010 18:24
ISPconfig setup - DNS, router and general access problems ingvar Installation/Configuration 6 31st July 2010 13:13
Chrome + Ubuntu + Flash player andor Desktop Operation 1 25th May 2010 16:59
Debian perfect setup network problem reddogg Installation/Configuration 2 18th January 2006 22:04


All times are GMT +2. The time now is 10:47.


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