環境公司局域網, 代理 服務器 :168.160.1.3 host:168.160.2.51 saloris:168.160.2.49 模式: 橋接。 #ifconfig -a lo0: flags=1000849UP,LOOPBACK,RUN" name="description" />
環境公司局域網, 代理服務器:168.160.1.3
host:168.160.2.51
saloris:168.160.2.49 模式: 橋接。
#ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICADT< IPv4>mtu 8282 index 1
inet 127.0.0.1 netmask ff000000
pcn0:flags=1000843<UP,BROADCAST,RUNNING<MULTICAST<IPv4 >mtu 1600 index 2
inet 168.160.2.51 netmask ffff0000 boadcast 168.160.255.255
ether 0:c:29:ec:e7:3a
參考網友帖子:(非常感謝)
solaris網絡配置 |
內容: -------------------------------------------------------------------------------- (1)設置網絡地址和子網掩碼 1. /etc/hostname.interface /etc/hostname.interface 文件給網卡進行命名,Interface是網卡的型號,有le、hme等。le是十兆網卡,hme為百兆網卡等等。后面跟一個數字,第一個十兆網卡為le0,第二個為le1;第二個百兆網卡為hme0,第二個為hme1等等。文件的內容是這塊網卡的名字,如Sunrise、Sunny。 #more /etc/hostname.le0 Sunrise # more /etc/hostname.hme0 Sunny 2. /etc/hosts文件 /etc/hosts文件將網卡名與IP地址進行了映射,與/etc/hostname.interface 協同工作,配置本機網卡地址的IP地址。 # more /etc/hosts 127.0.0.1 localhost loghost 172.16.255.1 Sunrise 172.18.255.1 Sunny 系統名不是主機名,主機名是唯一的,要更改主機名,用命令:hostname。 有了/etc/hostname.interface和/etc/hosts兩個文件,系統就知道如何配置網卡了,如第一個百兆網卡的名字是Sunny,其對應的地址是172.18.255.1。 3. /etc/netmasks文件 將網絡的IP地址與網絡地址聯系一起,劃分子網。如果是處于標準網段,則不需要配置 標準網段: A類網:0-127(127用于本地地址) 掩碼:255..0.0.0 B類網:128-191 掩碼:255.255.0.0 C類網:192-223 掩碼:255.255.255.0 D類網:224-254(用于多址廣播) 要配一個B類地址:172.16.255.1掩碼為:255.255.255.0,則在/etc/netmasks文件中寫: 172.16.255.0 255.255.255.0 4. ifconfig命令 檢測網絡端口狀態 #ifconfig -a 配置網絡端口地址 #ifconfig le0 172.16.255.1 netmask 255.255.255.0 配置網絡端口狀態 #ifconfig le0 up/down 配置網絡端口是否可用 #ifconfig le0 plumb/unplumb 5. ping命令 檢測網絡狀態 測試網絡速度 (2)路由和網關 1. /etc/defaulrouter文件 /etc/defaulrouter文件配置系統的缺省路由,防止不必要的路由進程,適用于只有一個路由器通向其它網段的網絡。系統安裝時并沒有該文件,是用戶自己創建的。文件內容是缺省路由的地址。 #cat /etc/defaultrouter 172.16.255.254 優點: 占用資源少,只有一條路由條目。 (3)DNS客戶端的設置 1. /etc/resolv.conf文件 記錄DNS服務器的地址和域名 關鍵字: domainname nameserver # more /etc/resolv.conf nameserver 172.16.255.3 domainname sunrise.com.cn 2. /etc/nsswitch.conf文件 記錄主機名的搜索順序等信息 # more /etc/nsswitch.conf # # /etc/nsswitch.dns: # # An example file that could be copied over to /etc/nsswitch.conf; it uses # DNS for hosts lookups, otherwise it does not use any other naming service. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports. passwd: files group: files # You must also set up the /etc/resolv.conf file for DNS name # server lookup. See resolv.conf(4). hosts: files dns ipnodes: files … … 將這個文件的hosts記錄配置成hosts: files dns |
匿名網友 評論于 2005年07月26日00時07分 |
標題:參考來自: |
內容:http://bbs.chinaunix.net/forum/viewtopic.php?t=582524&show_type= |