安裝兩張網絡卡

作者:Andrew Choi (蔡健發)

Since : 15 Jun 2002

Last Update : 5 Jun 2006



聲明:任何形式的摘抄必須保留上述作者和http地址

  • 基本資料:

    第一張網卡IP = 192.168.10.1
    /etc/hostname.e???0 設定為 myhost1

    第二張網卡IP = 192.168.20.1

    /etc/hostname.e???1 設定為 myhost2

    網卡型號 = 3Com 3c905

    ??? : 一般情況用不同品牌的網卡會有不同的名稱,而我使用的是 3Com 3c905,所以 ??? lxl
    e.g. /etc/hostname.elxl0

  • 使用 ifconfig 檢查 Solaris 是否已經便認出兩張網卡的存在:

    # ifconfig -a
    lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    elxl0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet 192.168.10.1 netmask ffffff00 broadcast 192.168.10.255
    ether 0:60:8:66:d1:56

    如果是有兩張網卡的話是應該有elxl0elxl1,但從已上資料只有 elxl0,所以要從新設定網卡。

    • 使用 sys-unconfigSolaris 的網卡設定取消,待從新啟動電腦後,樣電腦自動檢查網卡。
      注意:在使用 sys-unconfig 之前,你一定要把網卡的 Driver 安裝好,否則,在 Reboot 後系統無法檢查到你的網卡。

      # sys-unconfig
      WARNING

      This program will unconfigure your system. It will cause it
      to revert to a "blank" system - it will not have a name or know
      about other systems or networks.

      This program will also halt the system.

      Do you want to continue (y/n) ? y

      Solaris 便會立即 Reboot

    • Reboot 後:

      1. Select a Locale 選擇 0. English (C - 7-bit ASCII)
      2. 設定及測試你的 Windows 系統
      3. Solaris 開始檢測你的網卡

        Cofiguring network interface address : elxl0 elxl1

        你顯示出來的名稱不一定是 elxl0 elxl1,所以你要用筆先記下來。一般情況用不同品牌的網卡會有不同的名稱,而我使用的是 3Com 3c905
      4. Choice Networked : Yes
      5. Use DHCP : No
      6. Primary Network interface : elxl0 ( 這是選擇誰是第一張網卡 )
      7. Host Name : myhost1 ( 主機名稱是由你自行決定 )
      8. IP address : 192.168.10.1 ( 設定 elxl0 IP address 192.168.10.1)
      9. System part of a subnet : Yes
      10. Netmask : 255.255.255.0
      11. Enable IPV6 : No
      12. Configure Kerberos Security : No
      13. Name Service : None
      14. Regions : Asia, Eastern ( 東南亞地區 )
      15. Time Zone : Hong Kong
      16. 設定 Root Password
      17. System Auto Reboot

    • 使用 ifconfig 檢查 Solaris 是否正確:

      # ifconfig -a
      lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
      inet 127.0.0.1 netmask ff000000
      elxl0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
      inet 192.168.10.1 netmask ffffff00 broadcast 192.168.10.255
      ether 0:60:8:66:d1:56

    • 設定兩張網卡的 IP Address Hosts Name

      # pico /etc/hosts ( pico is a editor program. You may use vi or other editer )
      127.0.0.1 localhost  
      192.168.10.1 myhost1 loghost
      192.168.20.1 mohost2  

      # pico /etc/hostname.elxl0 (
      一定是 elxl0 ,你要使用先前用筆先記下來的那一個名稱 )
      myhost1

      # pico /etc/hostname.elxl1 ( 一定是 elxl1 ,你要使用先前用筆先記下來的那一個名稱 )
      myhost2


      # pico /etc/netmasks
      192.168.10.0 255.255.255.0
      192.168.20.0 255.255.255.0

      Reboot 後再
      使用 ifconfig 檢查 Solaris 是否正確:

      # ifconfig -a
      lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
      inet 127.0.0.1 netmask ff000000
      elxl0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
      inet 192.168.10.1 netmask ffffff00 broadcast 192.168.10.255
      ether 0:60:8:66:d1:56

      elxl1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
      inet 192.168.20.1 netmask ffffff00 broadcast 192.168.20.255
      ether 0:4:75:86:fa:63

    • 設定要使用 DNS

      DNS Server = 202.96.134.133 and 61.144.56.100 ( You may choice your own DNS Server )


      # cp /etc/nsswitch.dns /etc/nsswitch.conf
      # pico /etc/resolv.conf
      nameserver 202.96.134.133
      nameserver 61.144.56.100

    • 完成

 



E-mail : andrew@tophk.net