Solaris IP 网关 DNS 配置

1.查询系统里有哪些网卡

 

#cat /etc/path_to_inst |grep network

结果如下

"/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/network@0" 0 "ce"

"/pci@1e,600000/pci@0/pci@9/pci@0,2/pci@1/network@1" 1 "ce"

"/pci@1e,600000/pci@0/pci@2/pci@0/network@4" 0 "bge"

"/pci@1e,600000/pci@0/pci@2/pci@0/network@4,1" 1 "bge"

 

这台机器有4块网卡:ce0,ce1,bge0,bge1,我们来配置bge0接口

 

 

2. ifconfig -a查看接口的名字

-bash-3.00# ifconfig -a

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

 

打开网络接口文件查看接口的名称

bash-3.00# more /etc/hostname. bge0

David

 

备注:如果没有对应的接口文件,需要创建接口文件

bash-3.00#touch /etc/hostname.bge0

并写入hostname的名称

 

 

3.修改host文件,使ip地址和接口一一对应
bash-3.00# more /etc/hosts

::1     localhost

127.0.0.1       localhost

10.85.10.78     david   loghost

4.修改netmask
more/etc/netmsks
#more netmasks
10.85.10.0 255.255.255.0


5. 修改默认网关
-bash-3.00# more /etc/defaultrouter

10.85.10.165

 

6. 修改dns客户端
-bash-3.00# more resolv.conf

domain mysf

nameserver 218.104.78.2

 

7. 修改 /etc/nsswitch.conf12

-bash-3.00# more /etc/nsswitch.conf

# You must also set up the /etc/resolv.conf file for DNS name

# server lookup.  See resolv.conf(4).

hosts: files dns

 

hosts:file改为hosts:files dns ,注意中间有空格.

 

8. 然后重启网络

-bash-3.00# ifconfig bge0 down

-bash-3.00# ifconfig bge0 up

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值