Linux中與網(wǎng)絡(luò)配置有關(guān)的文件.doc_第1頁
Linux中與網(wǎng)絡(luò)配置有關(guān)的文件.doc_第2頁
Linux中與網(wǎng)絡(luò)配置有關(guān)的文件.doc_第3頁
Linux中與網(wǎng)絡(luò)配置有關(guān)的文件.doc_第4頁
Linux中與網(wǎng)絡(luò)配置有關(guān)的文件.doc_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

Linux中與網(wǎng)絡(luò)配置有關(guān)的文件 /etc/hosts 這個(gè)文件是把IP地址和主機(jī)名聯(lián)系起來的簡(jiǎn)單文件。文件內(nèi)容如下:# Do not remove the following line, or various programs# that require network functionality will fail.spring localhost.localdomain localhost主機(jī)別名主機(jī)別名主機(jī)名IP地址#號(hào)開頭為注釋 /etc/services記錄著端口號(hào)和服務(wù)之間的對(duì)應(yīng)關(guān)系,這個(gè)文件不需要修改。文件內(nèi)容如下# /etc/services:# $Id: services,v 1.32 2003/01/09 17:56:30 dwalsh Exp $# Network services, Internet style# Note that it is presently the policy of IANA to assign a single well-known# port number for both TCP and UDP; hence, most entries here have two entries# even if the protocol doesnt support UDP operations.# Updated from RFC 1700, Assigned Numbers (October 1994). Not all ports# are included, only the more common ones.# The latest IANA port assignments can be gotten from#/assignments/port-numbers# The Well Known Ports are those from 0 through 1023.# The Registered Ports are those from 1024 through 49151# The Dynamic and/or Private Ports are those from 49152 through 65535# Each line describes one service, and is of the form:# # service-name port/protocol aliases . # commenttcpmux1/tcp# TCP port service multiplexertcpmux1/udp# TCP port service multiplexerrje5/tcp# Remote Job Entryrje5/udp# Remote Job Entryecho7/tcpecho7/udpdiscard9/tcpsink nulldiscard9/udpsink null /etc/sysconfig/network 這個(gè)文件可以配置一些基本的網(wǎng)絡(luò)信息。如主機(jī)名、網(wǎng)關(guān)。文件內(nèi)容如下:NETWORKING=yes 是否需要配置網(wǎng)絡(luò),值是yes或no ,一般為yes.HOSTNAME=spring 主機(jī)名,要更改主機(jī)名可以修改此項(xiàng),重啟后生效。GATEWAY=54 配置主機(jī)的網(wǎng)關(guān) /etc/host.conf 指定主機(jī)進(jìn)行域名解析時(shí)的查找順序。order hosts,bind先找hosts文件,再使用bind服務(wù)(bind為linux下的DNS服務(wù)程序),如果配置了DNS,可以改與order bind,hosts關(guān)鍵字,意思是順序 /etc/nsswitch.conf是由SUN公司開發(fā)的,用于管理系統(tǒng)中多個(gè)配置文件查找順序,比/etc/host.conf功能多,我們一般不使用。文件內(nèi)容如下:# /etc/nsswitch.conf# An example Name Service Switch config file. This file should be# sorted with the most-used services at the beginning.# The entry NOTFOUND=return means that the search for an# entry should stop if the search in the previous entry turned# up nothing. Note that if the search failed due to some other reason# (like no NIS server responding) then the search continues with the# next entry.# Legal entries are:#nisplus or nis+Use NIS+ (NIS version 3)#nis or ypUse NIS (NIS version 2), also called YP#dnsUse DNS (Domain Name Service)#filesUse the local files#dbUse the local database (.db) files#compatUse NIS on compat mode#hesiodUse Hesiod for user lookups#NOTFOUND=returnStop searching if not found so far# To use db, put the db in front of files for entries you want to be# looked up first in the databases# Example:#passwd: db files nisplus nis#shadow: db files nisplus nis#group: db files nisplus nispasswd: filesshadow: filesgroup: files#hosts: db files nisplus nis dnshosts: files dns# Example - obey only what nisplus tells us.#services: nisplus NOTFOUND=return files#networks: nisplus NOTFOUND=return files#protocols: nisplus NOTFOUND=return files#rpc: nisplus NOTFOUND=return files#ethers: nisplus NOTFOUND=return files#netmasks: nisplus NOTFOUND=return files bootparams: nisplus NOTFOUND=return filesethers: filesnetmasks: filesnetworks: filesprotocols: filesrpc: filesservices: filesnetgroup: filespublickey: nisplusautomount: filesaliases: files nisplus /etc/resolv.conf 這個(gè)文件記錄著域名服務(wù)器的位置。文件內(nèi)容如下:nameserver 54 最多寫三個(gè) /etc/sysconfig/network-scrips/ifcfg-eth0DEVICE=eth0 設(shè)備名稱BOOTPROTO=static IP地址等信息是如何獲得,可以是static或dhcpBROADCAST=55 廣播地址,BOOTPROTO=static時(shí)使用此項(xiàng)IPADDR=06 IP地址,BOOTPROTO=static時(shí)使用此項(xiàng)NETMASK= 子網(wǎng)掩碼, BOOTPROTO=static時(shí)使用此項(xiàng)NETWORK= 網(wǎng)絡(luò)地址,BOOTPROTO=static時(shí)使用此項(xiàng)ONBOOT=yes 計(jì)算機(jī)啟動(dòng)時(shí)是否啟動(dòng)網(wǎng)卡,值是yes或noUSERCTL=no 除root外,其他用戶是否可以控制該設(shè)備GETWAY=54 默認(rèn)網(wǎng)關(guān)Linux中與網(wǎng)絡(luò)有關(guān)的腳本文件 /etc/rc.d/init.d/network/etc/rc.d/init.d/network start 啟用網(wǎng)卡/etc/rc.d/init.d/network stop 停用網(wǎng)卡/etc/rc.d/init.d/network restart 重啟網(wǎng)卡/etc/rc.d/init.d/network reload 重啟網(wǎng)卡/etc/rc.d/init.d/network status 顯示網(wǎng)卡的是否啟動(dòng)了也可以用下面命令Service network start|stop|restart|reload|status /etc/syconfig/network-scrips/ifup/etc/syconfig/network-scrips/ifup eth0 啟用eth0或 ifup eth0 /etc/syconfig/network-scrips/ifdown/etc/syconfig/network-scrips/ifdown eth0 停用eth0或 ifdown eth0 /sbin/ifconfigifconfig 查看所有網(wǎng)卡的配置信息ifconfig eth0 查看eth0的配置信息ifconfig eth0 up 啟用eth0ifconfig eth0 down 停用eth0ifconfig eth0 5 netmask 配置eth0的IP地址和子網(wǎng)掩碼,直接生效且不把修改保存到配置文件ifconfig eth0 5 netmask up 配置eth0的IP地址和子網(wǎng)掩碼并啟用,直接生效且不把修改保存到配置文件 /sbin/netconfignetconfig 用圖形界面配置網(wǎng)卡的基本信息 /bin/pingping -c count -i inerval -t ttl -s packetsize destinationping -c 4 i 3 -t 60 s 1500 最多經(jīng)歷60個(gè)路由器 ping四次 每三秒發(fā)送一個(gè)數(shù)據(jù)包 每個(gè)數(shù)據(jù)包大小為1500字節(jié) /sbin/routeroute add|del|flush -net|-host target netmask gw dev route 查看路由表route add -host 0 eth0 填加到主機(jī)的路由route add -host 0 dev eth0 填加到主機(jī)的路由route add -host 0 gw 0 填加到主機(jī)的路由route del -host 0 刪除到主機(jī)的路由route add net /24 eth0 填加到網(wǎng)段的路由route add net /24 dev eth0 填加到網(wǎng)段的路由route add net /24 gw 0 填加到網(wǎng)段的路由route add net netmask eth0 填加到網(wǎng)段的路由route add net netmask dev eth0 填加到網(wǎng)段的路由route add net netmask gw 0 填加到網(wǎng)段的路由route del net /24 刪除到網(wǎng)段的路由route add default eth0 填加默認(rèn)網(wǎng)關(guān)route add default gw 0 eth0 填加默認(rèn)網(wǎng)關(guān)route add default gw 0 dev eth0 填加默認(rèn)網(wǎng)關(guān)route del default 刪除默認(rèn)網(wǎng)關(guān) /usr/sbin/traceroutetraceroute 主機(jī)名 解析目標(biāo)主機(jī)和源主機(jī)之間經(jīng)過別些路由 ADSL配置需要的軟件包ppp-2.4.1-10、rp-pppoe-3.5-2/usr/sbin/adsl-setup 配置ADLS/usr/sbin/adsl-stop 掛斷/usr/sbin/adsl-start 撥號(hào)/usr/sbin/adsl-status 查看狀態(tài)注意問題:如果不能正確連接,進(jìn)行后面的操作,刪除默認(rèn)網(wǎng)關(guān)和默認(rèn)路由,并添加新的默認(rèn)路由route add default ppp0,使用netstat nr查看是否有默認(rèn)路由。Enter your Login Name (default root): 512632114 此處寫從ISP獲得的ADSL號(hào)INTERFACEEnter the Ethernet interface connected to the ADSL modemFor Solaris, this is likely to be something like /dev/hme0.For Linux, it will be ethX, where X is a number.(default eth0): 此處寫連接ADSL的設(shè)備名,不填默認(rèn)是eth0Do you want the link to come up on demand, or stay up continuously?If you want it to come up on demand, enter the idle time in secondsafter which the link should be dropped. If you want the link tostay up permanently, enter no (two letters, lower-case.)NOTE: Demand-activated links do not interact well with dynamic IPaddresses. You may have some problems with demand-activated links.Enter the demand value (default no): 是否自動(dòng)斷線。DNSPlease enter the IP address of your ISPs primary DNS server.If your ISP claims that the server will provide dynamic DNS addresses,enter server (all lower-case) here. 首選域名服務(wù)器地址If you just press enter, I will assume you know what you aredoing and not modify your DNS setup.Enter the DNS information here: Please enter the IP address of your ISPs secondary DNS server.If you just press enter, I will assume there is only one DNS server.Enter the secondary DNS server address here: 備用DNS服務(wù)器PASSWORDPlease enter your Password: 12345678 輸入ADSL登錄密碼Please re-enter your Password: 12345678 重新輸入登錄ADSL密碼USERCTRLPlease enter yes (two letters, lower-case.) if you want to allownormal user to start or stop DSL connection (default yes): no 是否允許其他人控制ADSL,默認(rèn)是允許。FIREWALLINGPlease choose the firewall rules to use. Note that these rules arevery basic. You are strongly encouraged to use a more sophisticatedfirewall setup; however, these will provide basic security. If youare running any servers on your machine, you must choose NONE andset up firewalling yourself. Otherwise, the firewall rules will denyaccess to all standard servers like Web, e-mail, ftp, etc. If youare using SSH, the rules will block outgoing SSH connections whichallocate a privileged source port.The firewall choices are:0 - NONE: This script will not set any firewall rules. You are responsible for ensuring the security of your machine. You are STRONGLY recommended to use some kind of firewall rules.1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway for a LANChoose a type of firewal

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論