I have just rented a 1and1.com
Root Server with Ubuntu 10.04 LTS minimum installation. 1and1.com has a specific way of assigning IPs through DHCP to dedicated servers and I would happily live with DHCP, but I want to utilize Virtualmin, for which static IP is recommended as it stated reads on
http://www.virtualmin.com/documentation/dns/faq:
Quote:
While obtaining an IP address, the DNS servers provided by your DHCP server are used in place of what's currently setup on your server.
For a server, we'd suggest using static IP's where possible. That would prevent your DNS servers from being overwritten, as well as removing any chance of your server obtaining the wrong IP address.
|
I've been struggling to turn 1and1's DHCP IP to static IP for already two days, exhausted and gladly will offer some bounty to anyone who solves this Gordian Knot.
Given data:
Server IP: 84.208.133.16 (1and1 gives only one free IP with the server, so no other IPs)
Code:
cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
84.208.133.16 u16150189.onlinehome-server.com u16150189
84.208.133.16 default-domain.com
(I don't change anything here for now, since my goal to get DHCP IP changed to static one.)
Code:
cat /etc/network/interfaces
# The loopback network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
# auto eth0
# iface eth0 inet static
# address 84.208.133.16
# netmask 255.255.255.255
# broadcast 84.208.133.16
# network 84.208.133.16
# gateway 10.255.255.1
Code:
ifconfig
eth0 Link encap:Ethernet HWaddr 00:25:90:57:f1:4a
inet addr:84.208.133.16 Bcast:84.208.133.16 Mask:255.255.255.255
inet6 addr: fe80::225:90ff:fe57:f14a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3541 errors:0 dropped:0 overruns:0 frame:0
TX packets:571 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:292548 (292.5 KB) TX bytes:70346 (70.3 KB)
Interrupt:17 Memory:fe9e0000-fea00000
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:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2704 (2.7 KB) TX bytes:2704 (2.7 KB)
Code:
netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.255.255.1 0.0.0.0 UG 0 0 0 eth0
10.255.255.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
After commenting out dhcp, opening static interface
Code:
# The loopback network interface
auto lo eth0
iface lo inet loopback
# iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 84.208.133.16
netmask 255.255.255.255
broadcast 84.208.133.16
network 84.208.133.16
gateway 10.255.255.1
and running
Code:
/etc/init.d/networking restart
I loose SSH connection and the networks never comes back.
Luckily 1and1 provides console through which I can access my server and change the settings.
What else I should do to get this done? Anyone can help me with this for some bounty, please?