




已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
Linux中與網(wǎng)絡配置有關(guān)的文件 /etc/hosts 這個文件是把IP地址和主機名聯(lián)系起來的簡單文件。文件內(nèi)容如下:# Do not remove the following line, or various programs# that require network functionality will fail.spring localhost.localdomain localhost主機別名主機別名主機名IP地址#號開頭為注釋 /etc/services記錄著端口號和服務之間的對應關(guān)系,這個文件不需要修改。文件內(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 這個文件可以配置一些基本的網(wǎng)絡信息。如主機名、網(wǎng)關(guān)。文件內(nèi)容如下:NETWORKING=yes 是否需要配置網(wǎng)絡,值是yes或no ,一般為yes.HOSTNAME=spring 主機名,要更改主機名可以修改此項,重啟后生效。GATEWAY=54 配置主機的網(wǎng)關(guān) /etc/host.conf 指定主機進行域名解析時的查找順序。order hosts,bind先找hosts文件,再使用bind服務(bind為linux下的DNS服務程序),如果配置了DNS,可以改與order bind,hosts關(guān)鍵字,意思是順序 /etc/nsswitch.conf是由SUN公司開發(fā)的,用于管理系統(tǒng)中多個配置文件查找順序,比/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 這個文件記錄著域名服務器的位置。文件內(nèi)容如下:nameserver 54 最多寫三個 /etc/sysconfig/network-scrips/ifcfg-eth0DEVICE=eth0 設備名稱BOOTPROTO=static IP地址等信息是如何獲得,可以是static或dhcpBROADCAST=55 廣播地址,BOOTPROTO=static時使用此項IPADDR=06 IP地址,BOOTPROTO=static時使用此項NETMASK= 子網(wǎng)掩碼, BOOTPROTO=static時使用此項NETWORK= 網(wǎng)絡地址,BOOTPROTO=static時使用此項ONBOOT=yes 計算機啟動時是否啟動網(wǎng)卡,值是yes或noUSERCTL=no 除root外,其他用戶是否可以控制該設備GETWAY=54 默認網(wǎng)關(guān)Linux中與網(wǎng)絡有關(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)卡的是否啟動了也可以用下面命令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個路由器 ping四次 每三秒發(fā)送一個數(shù)據(jù)包 每個數(shù)據(jù)包大小為1500字節(jié) /sbin/routeroute add|del|flush -net|-host target netmask gw dev route 查看路由表route add -host 0 eth0 填加到主機的路由route add -host 0 dev eth0 填加到主機的路由route add -host 0 gw 0 填加到主機的路由route del -host 0 刪除到主機的路由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 填加默認網(wǎng)關(guān)route add default gw 0 eth0 填加默認網(wǎng)關(guān)route add default gw 0 dev eth0 填加默認網(wǎng)關(guān)route del default 刪除默認網(wǎng)關(guān) /usr/sbin/traceroutetraceroute 主機名 解析目標主機和源主機之間經(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 撥號/usr/sbin/adsl-status 查看狀態(tài)注意問題:如果不能正確連接,進行后面的操作,刪除默認網(wǎng)關(guān)和默認路由,并添加新的默認路由route add default ppp0,使用netstat nr查看是否有默認路由。Enter your Login Name (default root): 512632114 此處寫從ISP獲得的ADSL號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的設備名,不填默認是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): 是否自動斷線。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. 首選域名服務器地址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服務器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,默認是允許。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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 大學食堂秋分活動方案
- 備課單展示活動方案
- 太保壽險客戶活動方案
- 大班《排序》活動方案
- 東莞虎年活動方案
- 個體輔導活動方案
- 中俄科技創(chuàng)新活動方案
- 中醫(yī)養(yǎng)生保健活動方案
- 中醫(yī)社區(qū)義診活動方案
- 中醫(yī)食療活動方案
- 藥物配伍禁忌查詢表
- 水 泵 安 裝 記 錄
- 大健康產(chǎn)業(yè)商業(yè)計劃書
- GB∕T 7528-2019 橡膠和塑料軟管及軟管組合件 術(shù)語
- 常州市機械行業(yè)安管考試題庫
- 門店日常衛(wèi)生檢查表
- FANUC機器人R-2000iA機械單元維護手冊
- 槽邊排風罩的設計計算
- 中國當代文學專題-國家開放大學2022年1月期末考試復習資料-漢語言本科復習資料
- 機動車維修經(jīng)營備案表
- 超星爾雅學習通《國際金融》2020章節(jié)測試含答案(上)
評論
0/150
提交評論