Click to See Complete Forum and Search --> : Change IP address in Linux


soleblazer
11-22-2001, 12:54 AM
Greetings,

Besides using the gui's, how can I change the ip address and gateway in Linux, on sun it was a matter of changing the hosts file and node file, and the defaultrouter file, anything like that here?

I appreciate the help, im trying to get my whole personal stuff on Linux now, these stupid things I know, and I hate the gui.

X_console
11-22-2001, 06:05 AM
Use ifconfig Check the man page for details on various options.

soleblazer
11-22-2001, 01:49 PM
Right, I know I can use ifconfig to do that and create the virtual interfaces of off ehth0, but those changes are not persistant right?

I just need to know where to put them so that when the run levels run the interface gets brought up correctly each time, I know I could simply put the commands in a shell script, but I am curious as to how Linux does this. On solaris its as simple as creating a hostname.hme0:1(or whatever interface) and then reference it in the hosts file....

Tks for any replay.

JC

bdg1983
11-22-2001, 05:13 PM
Try /etc/sysconfig/network-scripts/ifcfg-eth0

#!/bin/sh
#>>>Device type: ethernet
#>>>Variable declarations:
DEVICE="eth0"
IPADDR="192.168.1.4"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"
ONBOOT="yes"
DYNAMIC=""
#>>>End variable declarations