新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - 编程开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 操作系统 > Unix系统 > Solaris > 正文:Solaris 设置网卡IP地址

Solaris 设置网卡IP地址

新客网 XKER.COM 2008-03-09 来源: 收藏本文
? ifconfig
  ifconfig用于配置网卡地址,改动后立即生效,但并不保存配置,下次启动后失效。
  # ifconfig -a
  lo0: flags=849 mtu 8232
  inet 127.0.0.1 netmask ff000000
  hme0: flags=863 mtu 1500
  inet 172.16.255.2 netmask ffff0000 broadcast 172.16.255.255
  ether 8:0:20:ee:11:51
  #ifconfig hme0 172.16.3.3 netmask 255.255.255.0
  #ifconfig –a
  lo0: flags=849 mtu 8232
  inet 127.0.0.1 netmask ff000000
  hme0: flags=863 mtu 1500
  inet 172.16.3.3 netmask ffffff00 broadcast 172.16.3.255
  ether 8:0:20:ee:11:51
  
  
  ? /etc/hosts
  想要永久更改配置,则要更改配置文件,以网卡hme0为例:
  
  #more /etc/hostname.hme0
  Sunland
  #more /etc/hosts
  127.0.0.1 localhost
  172.16.255.2 Sunland loghost
  #vi /etc/hosts
  #more /etc/hosts
  127.0.0.1 localhost
  172.16.3.3 Sunland loghost
  #more /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. Currently this number is restricted to being a class
  # A, B, or C network number. In the future we should be able to support
  # arbitrary network numbers per the Classless Internet Domain Routing
  # guidelines.
  #
  # Both the network-number and the netmasks are specified in
  # "decimal dot" notation, e.g:
  #
  # 128.32.0.0 255.255.255.0
  #vi /etc/netmasks
  #more /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. Currently this number is restricted to being a class
  # A, B, or C network number. In the future we should be able to support
  # arbitrary network numbers per the Classless Internet Domain Routing
  # guidelines.
  #
  # Both the network-number and the netmasks are specified in
  # "decimal dot" notation, e.g:
  #
  # 128.32.0.0 255.255.255.0
  172.16.3.0 255.255.255.0
  #reboot
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐