- 论坛徽章:
- 0
|
1,先看一下系统有几块网卡:
#more /etc/path_to_inst |grep network
然后对需要配置ip的网卡进行配置。
【有的资料写用#kstat |grep net来查看】
2,配置一个网口的ip:
1)ifconfig ce3 plumb 启用ce3
2)ifconfig ce3 inet 10.0.106.41 netmask 255.255.255.252 broadcast + up
3)ifconfig -a 查看已经装载的网卡
【可以用ifconfig -a plumb 系统可识别的网卡全装载上来看看,然后ifconfig xxx unplumb 一个个关闭,呵呵。】
3,一个卡绑定多个ip
举例说明,网卡名hme0:
# vi /etc/hosts
127.0.0.1 localhost
192.168.2.1 test1 loghost
192.168.9.15 test2
192.168.9.65 test3
# vi /etc/netmasks
192.168.2.0 255.255.255.0
192.168.9.0 255.255.255.192
192.168.9.64 255.255.255.252
#vi /etc/hostname.hme0
test1(或直接写ip)
#vi /etc/hostname.hme0:1
test2
#vi /etc/hostname.hme0:2
test3
上面的几步,是直接修改配置文件,系统重启后配置仍然有效。
下面是利用命令来进行配置,但是在系统重启后配置会丢失的:
# ifconfig hme0 inet 192.168.2.1 netmask 255.255.255.0 broadcast + up
# ifconfig hme0:1 inet 192.168.9.15 netmask 255.255.255.192 broadcast + up
# ifconfig hme0 inet 192.168.9.65 netmask 255.255.255.252 broadcast + up
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/25155/showart_410873.html |
|