LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   assign static IP to the server (https://www.linuxquestions.org/questions/linux-general-1/assign-static-ip-to-the-server-300067/)

ashley75 03-10-2005 02:04 PM

assign static IP to the server
 
I want to assign static IP to the server, I think I can change it in
/ect/hosts file.

So what is the differences between the step above and adding IP by using netconfig command???

caps_phisto 03-10-2005 04:20 PM

When you use the netconfig command you are not editing /etc/hosts. Instead you are editing /etc/sysconfig/network-scripts/ifcfg-ethX (where X is the interface number).

If you want to setup an interface by editing this file and not using netconfig this is what it should look like:

Code:

DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.0.10
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

Hope this helps!

Tinkster 03-10-2005 04:47 PM

Re: assign static IP to the server
 
Quote:

Originally posted by ashley75
I want to assign static IP to the server, I think I can change it in
/ect/hosts file.

So what is the differences between the step above and adding IP by using netconfig command???

netconfig like in Slackware?


/etc/hosts is NOT the place to change the machines
IP number, it's the place where you tell your machine
about loop-back and about OTHER machines.

In Slack look at /etc/rc.d/rc.inet1.conf


Cheers,
Tink


All times are GMT -5. The time now is 02:44 PM.