Wednesday, April 13, 2005

Changing the Network Configuration on a UNIX OS

One Time Only

Set the ip address and netmask:
ipconfig $INTERFACE $IP netmask $NETMASK

Add a gateway:
route flush
route add default $GATEWAY

Add nameservers/DNS servers:
Edit to /etc/resolv.conf
The format is nameserver [tab] ip_address_of_name_server

Permanent Changes
Depends on the OS.

FreeBSD:
Edit /etc/rc.conf or use /stand/sysinstall, configure, network interface

Solaris:

/etc/hostname.$INTERFACENAME
/etc/hostnames
/etc/hosts
/etc/netmasks
/etc/defaultrouter <-- have the ip of the gateway, without this, your machine can't talk to outside networks, and you won't be able to ssh in except from the local network
Solaris 10: /etc/inet/ipaddrse1.conf
Solaris 10: /etc/inet/ipnodes --> see http://forum.sun.com/thread.jspa?threadID=18953&messageID=50817
You must add {ipaddress} {hostname} loghost to the end of ipnodes, or dtlogin will act funny, taking a long time to start and other problems.
-or-
Use sys-unconfig before moving to another network
On the next boot, the OS will ask you for the network configuration
The only parts that might be confusing: the default name service is NIS+. You want to use DNS instead.
If it asks what adapter to use, on the SuperSparcs I'm using its either le0 or hme0. le0 is the onboard NIC, hme0 is an sbus card.

Slackware:
/etc/rc.d/rc.inet$INTERFACENUMBERinKERNEL.conf

RedHat:
/etc/sysconfig/network-scripts/ifcfg-$INTERFACENAME

No comments:

Labels

Blog Archive

Contributors