Assigning static IP address to Debian machine?

0

I don't know how to use a static IP address on a Debian machine. Can anyone help?

I have the static IP address 83.222.248.100.

This is what I've tried:

$ cp /etc/network/interfaces /etc/network/interfaces.bak
$ sudo vi /etc/network/interfaces

And replaced:

iface eth0 inet dhcp

with the following text:

iface eth0 inet static
       address 83.222.248.100 
       gateway 83.222.248.1
       netmask 255.255.255.0
       network 83.222.248.0
       broadcast 83.222.248.255

(NB: I have no idea if those gateway/network/broadcast addresses are correct - can anyone advise?)

When I restart networking:

$ /etc/init.d/networking restart

I see:

Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
Reconfiguring network interfaces...SIOCDELRT: No such process

And it hangs forever.

Can anyone help?

simon

Posted 2011-05-04T11:36:32.893

Reputation: 163

Verify that your netmask and gateway is correct. As we don't know where you got that address from, we can not really tell you how. – Turbo J – 2011-05-04T12:43:08.767

Thanks. How do I verify this? I got the static IP from my hosting provider: there's just a button saying 'Get static IP' and it gave me "83.222.248.100". Nothing else! – simon – 2011-05-04T13:45:04.407

You're setting up a PC to be a router? What are you doing exactly? Remember that you've left a lot of network topology questions unanswered here. – Warren P – 2011-05-10T16:04:53.333

Answers

1

These two lines:

network 83.222.248.0
broadcast 83.222.248.255

are only necessary if you want to act as a router. To act as network peer you should only have address, gateway and netmask.

xxx

Posted 2011-05-04T11:36:32.893

Reputation: 11

It seems SIOCDLRT is some kind of error removing a route from the routing table. So my guess is that it's a routing problem. If the user really wants to do routing, they better explain what they want to do a lot better than "I want to set up a static IP". – Warren P – 2011-05-10T16:07:09.103

0

I haven't worked with Debian for about six months, but perhaps you could try the following:

$ /etc/init.d/networking stop
$ /etc/init.d/networking start

Jan Henckens

Posted 2011-05-04T11:36:32.893

Reputation: 420

0

I had a similar problem but with 'wlan0'. Try putting 'auto eth0' before 'iface eth0 inet static'.

auto eth0
iface eth0 inet static
   address 83.222.248.100 
   gateway 83.222.248.1
   netmask 255.255.255.0
   network 83.222.248.0
   broadcast 83.222.248.255

Juan

Posted 2011-05-04T11:36:32.893

Reputation: 1