Link to home
Start Free TrialLog in
Avatar of MrTV
MrTVFlag for Thailand

asked on

how can i set fix ipaddress indebian

How can i set fix ip address in debian what file and where is it
Avatar of fpintos
fpintos

You can set fix IP address for ethernet interface "eth0" at:

/etc/sysconfig/network-scripts/ifcfg-eth0

You will have one config file per ethernet interface

The content looks like the following for FIX ip address:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.6.255
IPADDR=192.168.6.204
NETMASK=255.255.255.0
NETWORK=192.168.6.0
ONBOOT=yes

Hope this help.

steps
1) go to /etc/sysconfig/network-scripts
2) cp ifcfg-eth0 ifcfg-etho.bak ( just backup the file in case if you mess up anything)
3) vi ifcfg-eth0
    change the  BOOTPROTO= static      
------------------------------------------------------------                      
 DEVICE=eth0
BOOTPROTO=static
HWADDR=04:60:9F:79:2E:6C
IPADDR=xxx.xxx.xx.xx                                              An example of how the file looks like
NETMASK=255.255.252.0
ONBOOT=yes
TYPE=Ethernet
----------------------------------------------------------------
Also give the ipaddr in case if you want to change it


sorry fpintos ...we gave the same solution at a gap of 4 mins...coincidence hehehe
No need to be sorry... I got in before you.... :-)
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You will also want to run this command:

/etc/init.d/networking restart

This will cause the changes to take effect