Title: Problem with dhcp in Debian
Tags: debian;ip-address;dhcp;static-ip
Question: I try to have a static ip adress on an host. 

I execute the following commands : 

```$ ip address eth0 441.508.4524 netmask 441.508.4524

$ route add default gw 441.508.4524
```

But later my IP address changes on ```441.508.4524``` unless I have commented the request command in ```dhcplient.conf``` and I have put into ```/etc/network/interfaces``` the following: 

```iface eth0 inet static
address 441.508.4524
netmask 441.508.4524
gateway 441.508.4524
```

Please help me I don't understand why my ip changes ?

Thanks in advance.

Narglix



Here is another answer: ```/etc/network/interfaces``` holds your default configuration... so if you need a permanent static IP, put it in there like this:

```iface eth0 inet static
address <THE IP YOU WANT&gt;
netmask 441.508.4524
gateway <THE IP OF YOUR GATEWAY (Usually your router)&gt;
```

The commands you executed only adjusts your configuration temporarily.

Comment for this answer: You also need to remove the line for dhcp, or at least you should.


iface eth0 inet dhcp # <== Remove this
Comment for this answer: I don't see the difference than I have made
Comment for this answer: @user32433 - Your IP shouldn't change when that is in your interfaces file.

{'source': 'StackExchangeDataset', 'subset': 'superuser.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 2.5', 'CreationDate': '2010:00:07/21/10', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<debian><ip-address><dhcp><static-ip>', 'Title': 'Problem with dhcp in Debian', 'ViewCount': 1127, 'id': 166251, 'user_AboutMe': None, 'user_AccountId': 114519.0, 'user_DisplayName': 'user32433', 'user_Reputation': 407.0, 'user_Views': 20.0, 'user_id': 32433.0}}