# ip changes

## htb.support

Hi,

I tried to change the ip address using the following command :- 

ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up

Ip gets changed, but after I reboot the machine, the ip is revert back to the old one.   :Embarassed: 

Any solution on it ?

Thanks,

Austiin

----------

## chiefbag

You need to set this in your /etc/conf.d/net file 

something like the following should do.

```
config_eth0=( "192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255" )
```

OR

```
config_eth0=( "192.168.1.5" )

routes_eth0=( "default via 192.168.1.254" )
```

----------

## htb.support

I tried to follow the above steps and then restarted the /etc/init.d/net.eth0 service, but it does not take the ip address, it shows 192 ip instead of 203

Any suggestion would be appricated.

- Austin

----------

## htb.support

Also, after I reboot my system, it still shows Mode = Normal, which I think it should show DHCP

Any idea about this ?

- Austin

----------

## Hu

Please show us the output of nl /etc/conf.d/net and the full output of the command you think is returning incorrect output.

----------

## chiefbag

 *Quote:*   

> I tried to follow the above steps and then restarted the /etc/init.d/net.eth0 service, but it does not take the ip address, it shows 192 ip instead of 203

 

Where are you getting the "203" figure from?, I did,nt see any reference to that in your initial nor the config that I posted so therefore I would not expect to see 203 in any part of the ip address or route.

----------

## Sysa

What is your baselayout?

----------

## htb.support

Thanks for all you help.

I was able to resolve this issue, I simple disable DHCP and connect the machine to direct connection instead of going through a switch.   :Razz: 

I understand it was a silly mistake from my end. Thanks again for your response.

- Austin

----------

