Solaris下的网络管理

  • Configuring networking

    Configuring networking is a multi-step process. Will you be using DNS? Do you know the DNS server names/IPs? Do you have a IP address,etc. In this case, lets say we are going to use DNS on this system.

    Set the name of the machine
    You need to put the name of the machine in the /etc/nodename file.

    Tell Solaris that we're going to use DNS

    By default, Solaris is not setup to use DNS. To make the change, we have to edit the /etc/nsswitch.conf

    file.

    Open this file and look for the line which starts with "hosts:".
    Add "dns" to the end of this line.

    You can also add the "dns" entry to the beginning of the line, which changes the order in which Solaris will do name lookups. For example, if you have "nis" before "dns", Solaris will first look in the NIS database. If you have "files" before "dns", Solaris will look at the /etc/hosts file before it looks at DNS.



    Tell Solaris about your DNS servers
    Edit the /etc/resolv.conf file. This file may not exist already, but you can just create it with a text editor.

    Here is an example /etc/resolv.conf file (from devnull.unixville.com)

    search unixville.com
    domain unixville.com
    nameserver 216.242.178.2
    nameserver 216.242.178.3
    nameserver 204.235.100.130
    nameserver 24.1.0.33
    nameserver 198.6.1.202



    The first line tells the OS to search first in the "unixville.com" domain. The second line simply tells the OS what domain we are currently in (I think). The lines after that are listings of the DNS servers to use for lookup. They are used in the order they are in, so if the first DNS server does not respond, the OS knows to go to the second one and so forth.

    Add the machines info to the /etc/hosts file
    You will need to edit the /etc/hosts file and enter the name of the machine and its IP address. For example, for devnull.unixville.com, I just entered the following line in the /etc/hosts file:

    216.242.17.87 devnull


    You can leave all the rest of the data in /etc/hosts file as is.

    Also edit the following files:

    /etc/net/ticlts/hosts
    /etc/net/ticots/hosts
    /etc/net/ticotsord/hosts


    Edit the interfaces hostname file.
    Since Sun systems can have multiple network cards, and each of those cards may answer to a different hostname, you need to also edit a file to assign the hostname to the main network card. This is usefull because you may want a single server to respond to many different names, each on a different network card.



    The main network interface is usually hme0. Most Sun 10/100 cards are known as hme cards, due to the internal codename during development, happy meal. Other cards, such as the 10/100 Quad card, show up in Solaris as qfe, and since this card has 4 ethernet controllers built in, they are accessed as qfe0,qfe1,qfe2 and qfe3.

    To edit the name of the interface, simply edit the /etc/hostname.[interface] file.

    For example, for the built in hme0 card, you would edit the /etc/hostname.hme0 file. For the second ethernet interface on a Quad card (if you have one), you would edit the /etc/hostname.qfe1 file. The reason it's 1 is because the computer counts from 0, but it can get confusing when dealing with multiple qfe cards, so keep it in mind.



    If you are changing netmask
    Edit the following file with your netmask and network number:

    /etc/inet/netmasks


  • Using network commands

    Show network routing table information
    Use /usr/bin/netstat. For example: netstat -rn

    Show network interface information
    Use /usr/sbin/ifconfig. For example: ifconfig -a

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值