2007年5月4日星期五

Solaris 网络配置

  • 网络基本配置文件
  1. /etc/hosts 主机名解析。 The format of each line is:
    IP-address official-host-name nicknames... (eg:192.9.1.20 gaia # John Smith)
  2. /etc/hostname.bge0 网络接口名
    t1000 可以通过创建hostname.bge0:1,构造第二网络接口
  3. /etc/netmasks 网络掩码
    # The netmasks file associates Internet Protocol (IP) address
    # masks with IP network numbers.
    # network-number netmask
    # 192.168.1.1 255.255.255.0
  4. /etc/resolv.conf 域名解析
    nameserver 211.151.88.20
    nameserver 211.151.94.26
    nameserver 202.106.196.115
  5. cat /etc/inetd.conf 服务项目定义
    100235/1 tli rpc/ticotsord wait root /usr/lib/fs/cachefs/cachefsd cachefsd"
  • 远程访问命令
  1. ssh --OpenSSH secure shell client (remote login program)
    命令格式:ssh user@remote.hostname.com
  2. scp --secure copy (remote file copy program)
    命令格式:scp localfile user@remote.hostname.com:./file
  • 网络监控
  1. ping 检测主机连接状况
    命令格式:/usr/sbin/ping host [ip]
  2. ifconfig 显示更改网络接口
    命令格式:/usr/sbin/ifconfig -a
    /usr/sbin/ifconfig -a
    lo0: flags=2001000849 mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    bge0: flags=1000843 mtu 1500 index 2
    inet 192.168.1.11 netmask ffffff00 broadcast 192.168.1.255

    其中,lo0:本机自回馈接口 ; bge0:第一个1G网络接口
  3. traceroute 跟踪网络路由
    命令格式:/usr/sbin/traceroute www.google.com
  4. netstat 显示与网络有关的数据
    命令格式:netstat -[a|i|o|r]
  5. rusers 网络上注册用户
    命令格式:rusers -la
  6. rup 网络上的主机
    命令格式:rup
  7. route 路由设置
    命令格式:route [add|delete]设置网络路由。/etc/defaultroute --缺省静态路由
  8. arp 反向解析 /usr/sbin/arp
    Usage: arp hostname
    arp -a [-n]
    arp -d hostname
    arp -s hostname ether_addr [temp] [pub] [trail]
    arp -f filename
    arp -a 显示当前的IP-MAC对应表
  9. nfsstat 查看NFS状态
    -s server
    -c client

没有评论: