可以修改以下文件:
/etc/hostname.interface
/etc/hosts
/etc/hostname.xxx
/etc/defaultrouter(默认网关)
/etc/netmasks(掩码)
/etc/inet/ipnodes

然后重新启动系统,或者用ifconfig 来添加临时的IP地址.用route add default xxx.xxx.xxx.xxx来添加临时的默认网关,用这些命令更改的设置,在系统重启后就不会保存的。

注意修改IP,主机名的涉及的文件:
1. /etc/hostname.interface

Interface是网卡的型号,有le、hme等。Le是十兆网卡,hme为百兆网卡等等。后面跟一个数字,第一个十兆网卡为le0,第二个为le1;第二个百兆网卡为hme0,第二个为hme1等等。
文件的内容是这块网卡的名字,如Sunrise、Sunny。
#more /etc/hostname.le0
Sunrise
# more /etc/hostname.hme0
Sunny

2. /etc/hosts文件

系统名与IP地址的映射
与/etc/hostname.interface 协同工作,配置本机网卡地址
# more /etc/hosts
127.0.0.1 localhost loghost
172.16.255.1 Sunrise
172.18.255.1 Sunny

系统名不是机器名,机器名是唯一的,要更改机器名,用命令:hostname。

有了/etc/hostname.interface和/etc/hosts两个文件,系统就知道如何配置网卡了,如第一个百兆网卡的名字是Sunny,其对应的地址是172.18.255.1。

3. /etc/netmasks文件

将网络的IP地址与网络地址联系一起,划分子网
如果是标准网段,则不需要配置

标准网段:
A类网:0-127(127用于本地地址) 掩码:255..0.0.0
B类网:128-191 掩码:255.255.0.0
C类网:192-223 掩码:255.255.255.0
D类网:224-254(用于多址广播)

要配一个B类地址:172.16.255.1掩码为:255.255.255.0,则在/etc/netmasks文件中写:172.16.255.0 255.255.255.0

4. ifconfig命令

检测网络端口状态
#ifconfig -a
配置网络端口地址
#ifconfig le0 172.16.255.1 netmask 255.255.255.0
配置网络端口状态
#ifconfig le0 up/down
配置网络端口是否可用
#ifconfig le0 plumb/unplumb

1)文件:/etc/hostname.interface
接口描述:
网卡型号
十兆网卡:le
百兆网卡:hme
2)文件:/etc/hosts
功能描述:
系统名与IP地址的映射
与/etc/hostname.interface 协同工作,配置本机网卡地址
举例:
# more /etc/hosts
127.0.0.1 localhost loghost
10.12.255.1 xiaojg
10.13.255.1 xiaojg
3)文件:/etc/netmasks
功能描述:
将网络的IP地址与网络地址联系一起,划分子网
如果是标准网段,则不需要配置
4)命令:ifconfig
举例:
检测网络端口状态
#ifconfig -a
配置网络端口地址
#ifconfig le0 10.16.25.1 netmask 255.255.255.0
配置网络端口状态
#ifconfig le0 up/down
配置网络端口是否可用
#ifconfig le0 plumb/unplumb