免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3626 | 回复: 0
打印 上一主题 下一主题

solaris网卡关闭dhcp [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-23 00:16 |只看该作者 |倒序浏览
参考:
http://docs.sun.com/app/docs/doc/819-7058/dhcp-overview-33a?l=zh&a=view
http://www.rite-group.com/rich/solaris_dhcp.html


solaris 10 dhcp优先静态ip????
请查看/etc/下面是否有/dhcp.netcardname文件  (若你需要配置静态ip,请删除此文件)
例如:
/etc/dhcp.pcn0
我之前一直设置静态ip不成功,还以为虚拟机的问题呢。。solaris不熟悉。。。汗一个~
今天看文章
http://qzone.qq.com/blog/56148083-1215182060

才发现。。。。
做个记号给需要的兄弟!   

配置静态ip

bash-3.00# uname -a
SunOS myhostname 5.10 Generic_120012-14 i86pc i386 i86pc
bash-3.00# cat /etc/hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.150 myhostname loghost
bash-3.00# cat /etc/nodename
myhostname
bash-3.00# cat /etc/hostname.pcn0
myhostname
bash-3.00# cat /etc/defaultrouter
192.168.1.1
bash-3.00# cat /etc/netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
192.168.1.0 255.255.255.0
bash-3.00# cat /etc/networks
#ident "@(#)networks 1.4 92/07/14 SMI" /* SVr4.0 1.1 */
#
# The networks file associates Internet Protocol (IP) network numbers
# with network names. The format of this file is:
#
# network-name network-number nicnames . . .
#
#
# The loopback network is used only for intra-machine communication
#
loopback 127
#
# Internet networks
#
arpanet 10 arpa # Historical
192.168.1.0 255.255.255.0 pcn0
bash-3.00#检查一下,重启系统,输入命令查看ip就得到我配置的静态ip啦
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
pcn0: flags=1000843 mtu 1500 index 2
        inet 192.168.1.150 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:69:d5:7b
bash-3.00#  

开启dhcp
touch /dhcp.netcardname即可。(不输入任何东西)
之后重启系统

bash-3.00# cat /etc/dhcp.pcn0   (对,重启后里面还是没任何东西!)
bash-3.00# ifconfig -a
lo0: flags=2001000849UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
pcn0: flags=1004843UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 192.168.1.103 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:69:d5:7b
bash-3.00# 可以看到重启系统之后ip变化了哟,注意看红色一行里面有个DHCP字段哟~


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/32515/showart_1735917.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP