




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、ip route 命令的作用詳解 屏蔽訪問IP和域名命令行下運(yùn)行 route -p(-P表示重啟后生效) add destip MASK 55 (用你要屏蔽的IP地址替換destip)可能會(huì)報(bào)錯(cuò),但是可以用 route print(知識(shí)若不分享 實(shí)在沒有意義 ) 看到它確實(shí)加進(jìn)去了比如route -p add MASK 55 route -p add MASK 55 恢復(fù)屏蔽IProut
2、e delete 10 mask 55?屏蔽域名windows/system32/drivers/etc/hosts怎樣屏蔽IP地址通常情況下,使用防火墻來(lái)阻斷因特網(wǎng)交通是最好的辦法。但是,低端防火墻,比如Internet Connection Firewall并不能過濾單個(gè)IP地址。有一個(gè)過濾單個(gè)IP地址的辦法是調(diào)整電腦上的路由表。路由命令行工具可以解決這個(gè)問題。這是一個(gè)較難使用的工 具。不懂路由知識(shí)而貿(mào)然調(diào)整可能會(huì)導(dǎo)致電腦與網(wǎng)絡(luò)失去連接。下面這樣的命令可以阻斷與IP地址為的通信:route p add 220.189
3、.126.2 MASK 55 METRIC 1 IF 2需要根據(jù)你的計(jì)算機(jī)調(diào)整接口號(hào)碼,目的地IP應(yīng)改為本地網(wǎng)絡(luò)上以前不存在的一個(gè)地址。像我前面所說(shuō)的,解決辦法并不容易。Route命令詳解在本地 IP 路由表中顯示和修改條目。語(yǔ)法route -f -p Command Destination mask Netmask Gateway metric Metric if Interface參數(shù)-f清除所有不是主路由(網(wǎng)掩碼為 55 的路由)、環(huán)回網(wǎng)絡(luò)路由(目標(biāo)為 ,網(wǎng)掩碼為 的
4、路由)或多播路由(目標(biāo)為 ,網(wǎng)掩碼為 的路由)的條目的路由表。如果它與命令之一(例如 add、change 或 delete)結(jié)合使用,表會(huì)在運(yùn)行命令之前清除。-p與 add 命令共同使用時(shí),指定路由被添加到注冊(cè)表并在啟動(dòng) TCP/IP 協(xié)議的時(shí)候初始化 IP 路由表。默認(rèn)情況下,啟動(dòng) TCP/IP 協(xié)議時(shí)不會(huì)保存添加的路由。與 print 命令一起使用時(shí),則顯示永久路由列表。所有其它的命令都忽略此參數(shù)。永久路由存儲(chǔ)在注冊(cè)表中的位置是 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParamet
5、ers PersistentRoutes。Command指定要運(yùn)行的命令。下表列出了有效的命令。 命令 目的add 添加路由change 更改現(xiàn)存路由delete 刪除路由print 打印路由Destination指定路由的網(wǎng)絡(luò)目標(biāo)地址。目標(biāo)地址可以是一個(gè) IP 網(wǎng)絡(luò)地址(其中網(wǎng)絡(luò)地址的主機(jī)地址位設(shè)置為 0),對(duì)于主機(jī)路由是 IP 地址,對(duì)于默認(rèn)路由是 。mask subnetmask指定與網(wǎng)絡(luò)目標(biāo)地址相關(guān)聯(lián)的網(wǎng)掩碼(又稱之為子網(wǎng)掩碼)。子網(wǎng)掩碼對(duì)于 IP 網(wǎng)絡(luò)地址可以是一適當(dāng)?shù)淖泳W(wǎng)掩碼,對(duì)于主機(jī)路由是 55 ,對(duì)于默認(rèn)路由是 。如果忽略,
6、則使用子網(wǎng)掩碼 55。定義路由時(shí)由于目標(biāo)地址和子網(wǎng)掩碼之間的關(guān)系,目標(biāo)地址不能比它對(duì)應(yīng)的子網(wǎng)掩碼更為詳細(xì)。換句話說(shuō),如果子網(wǎng)掩碼的一位 是 0,則目標(biāo)地址中的對(duì)應(yīng)位就不能設(shè)置為 1。Gateway指定超過由網(wǎng)絡(luò)目標(biāo)和子網(wǎng)掩碼定義的可達(dá)到的地址集的前一個(gè)或下一個(gè)躍點(diǎn) IP 地址。對(duì)于本地連接的子網(wǎng)路由,網(wǎng)關(guān)地址是分配給連接子網(wǎng)接口的 IP 地址。對(duì)于要經(jīng)過一個(gè)或多個(gè)路由器才可用到的遠(yuǎn)程路由,網(wǎng)關(guān)地址是一個(gè)分配給相鄰路由器的、可直接達(dá)到的 IP 地址。metric Metric為路由指定所需躍點(diǎn)數(shù)的整數(shù)值(范圍是 1 9999),它用來(lái)在路由表里的多個(gè)路由中選擇與轉(zhuǎn)發(fā)包中
7、的目標(biāo)地址最為匹配的路由。所選的路由具有最少的躍點(diǎn)數(shù)。躍點(diǎn)數(shù)能夠反映躍點(diǎn)的數(shù)量、路徑的速度、路徑可靠性、路徑吞吐量以及管理屬性。if Interface指定目標(biāo)可以到達(dá)的接口的接口索引。使用 route print 命令可以顯示接口及其對(duì)應(yīng)接口索引的列表。對(duì)于接口索引可以使用十進(jìn)制或十六進(jìn)制的值。對(duì)于十六進(jìn)制值,要在十六進(jìn)制數(shù)的前面加上 0x。忽略 if 參數(shù)時(shí),接口由網(wǎng)關(guān)地址確定。/?在命令提示符顯示幫助。注釋路 由表中 躍點(diǎn)數(shù) 一列的值較大是由于允許 TCP/IP 根據(jù)每個(gè) LAN接口的 IP 地址、子網(wǎng)掩碼和默認(rèn)網(wǎng)關(guān)的配置自動(dòng)確定路由表中路由的躍點(diǎn)數(shù)造成的。默認(rèn)啟動(dòng)的自動(dòng)確定接口躍點(diǎn)數(shù)確
8、定了每個(gè)接口的速度,調(diào)整了每個(gè)接口的路由躍點(diǎn)數(shù), 因此最快接口所創(chuàng)建的路由具有最低的躍點(diǎn)數(shù)。要?jiǎng)h除大躍點(diǎn)數(shù),請(qǐng)?jiān)诿總€(gè) LAN 連接的 TCP/IP 協(xié)議的高級(jí)屬性中禁用自動(dòng)確定接口躍點(diǎn)數(shù)。如果在 systemrootSystem32DriversEtc 文件夾的本地網(wǎng)絡(luò)文件中存在適當(dāng)?shù)臈l目,名稱可以用于 Destination。只要名稱可以通過“域名系統(tǒng)” (DNS) 查詢這樣的標(biāo)準(zhǔn)主機(jī)名解析技術(shù)分解為 IP 地址,就可以將其用于 Gateway,DNS 查詢使用存儲(chǔ)在 systemrootSystem32DriversEtc 文件夾下的本地主機(jī)文件和 NetBIOS 名稱解析。如果是 pri
9、nt 或 delete 命令,可以忽略 Gateway 參數(shù),使用通配符來(lái)表示目標(biāo)和網(wǎng)關(guān)。Destination 的值可以是由星號(hào) (*) 指定的通配符。如果指定目標(biāo)含有一個(gè)星號(hào) (*) 或問號(hào) (?),它被看作是通配符,只打印或刪除匹配的目標(biāo)路由。星號(hào)代表任意一字符序列,問號(hào)代表任一字符。例如, 10.*.1, 192.168.*、 127.* 和 *224* 都是星號(hào)通配符的有效使用。使用了無(wú)效的目標(biāo)和子網(wǎng)掩碼(網(wǎng)掩碼)值的組合,會(huì)顯示“Route:bad gateway address netmask”錯(cuò)誤消息。目標(biāo)中有一位或多位設(shè)置為 1,而其在子網(wǎng)掩碼中的對(duì)應(yīng)位設(shè)置為 0 時(shí)會(huì)發(fā)生這
10、個(gè)錯(cuò)誤??梢酝ㄟ^二進(jìn)制表示法表示目標(biāo)和子網(wǎng)掩碼來(lái)檢查這種情況。以二進(jìn)制表示的子網(wǎng)掩碼包括表示目標(biāo)網(wǎng)絡(luò)地址部分的一連串的 1 和表示目標(biāo)主機(jī)地址部分的一連串的 0 兩個(gè)部分。查看目標(biāo)以確定目標(biāo)的主機(jī)地址部分(由子網(wǎng)掩碼所定義)是否有些位設(shè)置成了 1。只有 Windows NT 4.0、Windows 2000、Windows Millennium Edition 和 Windows XP 的 route 命令支持 -p 參數(shù)。Windows 95 或 Windows 98 的 route 命令不支持該參數(shù)。只有當(dāng)網(wǎng)際協(xié)議 (TCP/IP) 協(xié)議在 網(wǎng)絡(luò)連接中安裝為網(wǎng)絡(luò)適配器屬性的組件時(shí),該命令才
11、可用。范例要顯示 IP 路由表的完整內(nèi)容,請(qǐng)鍵入:route print要顯示 IP 路由表中以 10. 開始的路由,請(qǐng)鍵入:route print 10.*要添加默認(rèn)網(wǎng)關(guān)地址為 的默認(rèn)路由,請(qǐng)鍵入:route add mask 要添加目標(biāo)為 ,子網(wǎng)掩碼為 ,下一個(gè)躍點(diǎn)地址為 的路由,請(qǐng)鍵入:route add mask 要添加目標(biāo)為 ,子網(wǎng)掩碼為 ,下
12、一個(gè)躍點(diǎn)地址為 的永久路由,請(qǐng)鍵入:route -p add mask 要添加目標(biāo)為 ,子網(wǎng)掩碼為 ,下一個(gè)躍點(diǎn)地址為 ,躍點(diǎn)數(shù)為 7 的路由,請(qǐng)鍵入:route add mask metric 7(知識(shí)若不分享 實(shí)在沒有意義 )要添加目標(biāo)為 ,子網(wǎng)掩碼為 ,下一個(gè)躍點(diǎn)地址為 ,接口索引為 0x3 的路由,請(qǐng)鍵入:route add 1
13、 mask if 0x3要?jiǎng)h除目標(biāo)為 ,子網(wǎng)掩碼為 的路由,請(qǐng)鍵入:route delete mask 要?jiǎng)h除 IP 路由表中以 10. 開始的所有路由,請(qǐng)鍵入:route delete 10.*要將目標(biāo)為 ,子網(wǎng)掩碼為 的路由的下一個(gè)躍點(diǎn)地址由 更改為 5,請(qǐng)鍵入:route change mask 5rout
14、e 的命令routing ip add/delete/set/show interface 在指定接口上添加、刪除、配置或顯示常規(guī) IP 路由設(shè)置。routing ip add/delete/set/show filter 在指定接口上添加、刪除、配置或顯示 IP 數(shù)據(jù)包篩選器。routing ip add/delete/show boundary 在指定接口上添加、刪除或顯示多播邊界設(shè)置。routing ip add/set ipiptunnel 添加或配置 IP 中的 IP 接口。routing ip add/delete/set/show rtmroute 添加、配置或顯示不持續(xù)的路由表
15、管理器路由。routing ip add/delete/set/show persistentroute 添加、刪除、配置或顯示持續(xù)路由。routing ip add/delete/set/show preferenceforprotocol 添加、刪除、配置或顯示路由協(xié)議的優(yōu)先級(jí)。routing ip add/delete/set/show scope 添加、刪除或顯示多播作用域。routing ip set/show loglevel 配置或顯示全局 IP 記錄等級(jí)。routing ip show helper 顯示 IP 的所有 Netsh 實(shí)用程序子環(huán)境。routing ip show
16、 protocol 顯示所有正在運(yùn)行的 IP 路由協(xié)議。routing ip show mfe 顯示多播轉(zhuǎn)發(fā)項(xiàng)。routing ip show mfestats 顯示多播轉(zhuǎn)發(fā)項(xiàng)統(tǒng)計(jì)。routing ip show boundarystats 顯示 IP 多播邊界。routing ip show rtmdestinations 顯示路由表管理器路由表中的目標(biāo)。routing ip show rtmroutes 顯示路由表管理器路由表中的路由。routing ip nat set/show global 配置或顯示全局網(wǎng)絡(luò)地址轉(zhuǎn)換 (NAT) 設(shè)置。routing ip nat add/delet
17、e/set/show interface 添加、刪除、配置或顯示指定接口的 NAT 設(shè)置。routing ip nat add/delete addressrange 在 NAT 接口公用地址池中添加或刪除一個(gè)地址范圍。routing ip nat add/delete addressmapping 添加或刪除 NAT 地址映射。routing ip nat add/delete portmapping 添加或刪除 NAT 端口映射。routing ip autodhcp set/show global 配置或顯示全局 DHCP 分配器參數(shù)。routing ip autodhcp set/sh
18、ow interface 配置或顯示指定接口的 DHCP 分配器設(shè)置。routing ip autodhcp add/delete exclusion 在 DHCP 分配器地址范圍中添加或刪除一個(gè)排除范圍。routing ip dnsproxy set/show global 配置或顯示全局 DNS 代理參數(shù)。routing ip dnsproxy set/show interface 配置或顯示指定接口的 DNS 代理參數(shù)。routing ip igmp set/show global 配置或顯示 IGMP 全局設(shè)置。routing ip igmp add/delete/set/show i
19、nterface 在指定接口上添加、刪除、配置或顯示 IGMP。routing ip igmp add/delete staticgroup 添加或刪除指定接口的靜態(tài)多播組。routing ip igmp show grouptable 顯示 IGMP 主機(jī)組表。routing ip igmp show ifstats 顯示每個(gè)接口的 IGMP 統(tǒng)計(jì)。routing ip igmp show iftable 顯示每個(gè)接口的 IGMP 主機(jī)組。routing ip igmp show proxygrouptable 顯示 IGMP 代理接口的 IGMP 組表。routing ip igmp sh
20、ow rasgrouptable 顯示遠(yuǎn)程訪問服務(wù)器所使用的 Internet 接口的組表。routing ip ospf set/show global 配置或顯示全局 OSPF 設(shè)置。routing ip ospf add/delete/set/show interface 在指定接口上添加、刪除、配置或顯示 OSPF。routing ip ospf add/delete/set/show area 添加、刪除、配置或顯示 OSPF 區(qū)域。routing ip ospf add/delete/show range 在指定的 OSPF 區(qū)域上添加、刪除、配置或顯示范圍。routing ip
21、ospf add/delete/set/show virtif 添加、刪除、配置或顯示 OSPF 虛擬接口。routing ip ospf add/delete/show neighbor 添加、刪除、配置或顯示 OSPF 鄰居。routing ip ospf add/delete/show protofilter 添加、刪除、配置或顯示 OSPF 外部路由的路由信息源。routing ip ospf add/delete/show routefilter 添加、刪除、配置或顯示 OSPF 外部路由的路由篩選。routing ip ospf show areastats 顯示 OSPF 區(qū)域統(tǒng)
22、計(jì)。routing ip ospf show lsdb 顯示 OSPF 鏈接狀態(tài)數(shù)據(jù)庫(kù)。routing ip ospf show virtifstats 顯示 OSPF 虛擬鏈接統(tǒng)計(jì)。routing ip relay set global 配置“DHCP 中繼代理程序”的全局設(shè)置。routing ip relay add/delete/set interface 在指定接口上添加、刪除或配置“DHCP 中繼代理程序”設(shè)置。routing ip relay add/delete dhcpserver 在 DHCP 服務(wù)器地址列表中添加或刪除 DHCP 服務(wù)器的 IP 地址。routing ip
23、relay show ifbinding 顯示接口的 IP 地址綁定。routing ip relay show ifconfig 顯示每個(gè)接口的“DHCP 中繼代理程序”配置。routing ip relay show ifstats 顯示每個(gè)接口的 DHCP 統(tǒng)計(jì)。routing ip rip set/show global 配置 IP 的 RIP 全局設(shè)置。routing ip rip add/delete/set/show interface 在指定接口上添加或配置 IP 的 RIP 設(shè)置。routing ip rip add/delete peerfilter 添加或刪除 RIP 對(duì)
24、等篩選器。routing ip rip add/delete acceptfilter 在接受的路由列表中添加或刪除 RIP 路由篩選器。routing ip rip add/delete announcefilter 在公布的路由列表中添加或刪除 RIP 路由篩選器。routing ip rip add/delete/show neighbor 添加或刪除 RIP 鄰居。routing ip rip set/show flags 在指定接口上配置 IP RIP 高級(jí)設(shè)置。routing ip rip show globalstats 顯示全局 RIP 參數(shù)。routing ip rip sh
25、ow ifbinding 顯示接口的 IP 地址綁定。routing ip rip show ifstats 顯示每個(gè)接口的 RIP 統(tǒng)計(jì)。IPX netsh 路由命令routing ipx add/set staticroute 在 IPX 路由表中添加或配置靜態(tài) IPX 路由。routing ipx add/set staticservice 在 SAP 服務(wù)表中添加或配置靜態(tài) SAP 服務(wù)。routing ipx add/set filter 在指定的接口上添加或配置 IPX 數(shù)據(jù)包篩選器。routing ipx add/set interface 在請(qǐng)求撥號(hào)接口上啟用 IPX 路由,或
26、在指定的接口上配置 IPX 設(shè)置。routing ipx set global 配置全局 IPX 路由設(shè)置。routing ipx rip add/set filter 添加和配置 RIP 路由篩選器。routing ipx rip set global 配置全局 IPX 的 RIP 設(shè)置。routing ipx rip set interface 在指定接口上配置 IPX 的 RIP 設(shè)置。routing ipx sap add/set filter 添加或配置 SAP 服務(wù)篩選器。routing ipx sap set global 配置全局 IPX 的 SAP 設(shè)置。routing ip
27、x sap set interface 在指定接口上配置 IPX 的 SAP 設(shè)置。routing ipx netbios add nbname 將靜態(tài) NETBIOS 名稱添加到 IPX NetBIOS 名稱表中。routing ipx netbios set interface 在指定接口上配置基于 IPX 的 NetBIOS 設(shè)置。(知識(shí)若不分享 實(shí)在沒有意義 )學(xué)習(xí)Windows網(wǎng)絡(luò)命令之route命令小檔案route命令主要用來(lái)管理本機(jī)路由表,可以查看,添加、修改或刪除路由表?xiàng)l目。該命令在win2000以上操作系統(tǒng)都可使用。命令格式如下:ROUTE -f -p command des
28、tination MASK netmask gateway METRIC metric IF interface帶方括號(hào)的參數(shù)可以省略。各參數(shù)含義如下:Command:可以是print(列出當(dāng)前路由表)、delete(刪除路由表?xiàng)l目)、add(添加路由表?xiàng)l目)和change(修改已有路由表?xiàng)l目)這些命令之一。-f:清空所有路由表的網(wǎng)關(guān)條目。如果與某個(gè)route指令一塊使用,會(huì)在執(zhí)行該命令前先清空路由表。-p:這個(gè)選項(xiàng)與add命令一塊使用時(shí)用于添加永久的靜態(tài)路由表?xiàng)l目。如果沒有這個(gè)參數(shù)添加的路由表?xiàng)l目在系統(tǒng)重啟后會(huì)丟失。如果其它命令使用這個(gè)選項(xiàng)此選項(xiàng)會(huì)被忽略。因?yàn)槠渌顚?duì)路由表的影響總是永久的
29、。在Windows 95系統(tǒng)的route命令不支持這個(gè)選項(xiàng)。destination、gateway 、netmask、metric和interface參數(shù)分別定義路由表?xiàng)l目中的目標(biāo)IP段,使用網(wǎng)關(guān),子網(wǎng)掩碼、度量值和網(wǎng)絡(luò)界面。(知識(shí)若不分享 實(shí)在沒有意義 )在命令中可以用字符串符號(hào)來(lái)替代目標(biāo)網(wǎng)絡(luò)和網(wǎng)關(guān)的IP表示,對(duì)于用符號(hào)名表示的網(wǎng)絡(luò),系統(tǒng)會(huì)查找networks文件來(lái)解析符號(hào)名對(duì)應(yīng)的網(wǎng)絡(luò) IP(這個(gè)文件在winxp系統(tǒng)一般位于C:WINDOWSsystem32driversetc目錄下),對(duì)于用符號(hào)名表示的網(wǎng)關(guān)系統(tǒng)會(huì)使用 HOSTS文件來(lái)對(duì)符號(hào)名進(jìn)行解析。如果是print或delete命令,目
30、標(biāo)網(wǎng)絡(luò)和網(wǎng)關(guān)可以包括通配符(*或?),而且網(wǎng)關(guān)參數(shù)可以省略。如果在目標(biāo)網(wǎng)絡(luò)定義中包含*或?,這時(shí)這些通配符會(huì)按其在命令行界面中的含義,及*代表多個(gè)任意字符而?代表一個(gè)任意字符。例如這樣157.*.1。注意:在添加或修改路由條目時(shí),如果目標(biāo)網(wǎng)絡(luò)與網(wǎng)絡(luò)掩碼不符會(huì)產(chǎn)生錯(cuò)誤,也即DEST & MASK) != DEST時(shí),會(huì)報(bào)錯(cuò)。注意,這個(gè)命令的很多部分是可以省略的,比如網(wǎng)絡(luò)界面常被省略。如果在添加或修改的路由條目中省略網(wǎng)絡(luò)界面參數(shù),系統(tǒng)會(huì)自動(dòng)使用到達(dá)指定網(wǎng)關(guān)最合適的網(wǎng)絡(luò)界面。例如,add命令的完全寫法可以如下:route ADD MASK 157.55
31、.80.1 METRIC 3 IF 2這條命令添加到達(dá)IP為掩碼為的目標(biāo)網(wǎng)絡(luò)的路由,指定網(wǎng)關(guān)為,跳數(shù)定義為3,使用網(wǎng)絡(luò)界面2,route PRINT 157*僅被出以157開頭的目標(biāo)網(wǎng)絡(luò)的路由條目。route DELETE (知識(shí)若不分享 實(shí)在沒有意義 )刪除到達(dá)目標(biāo)子網(wǎng)的路由條目。windows下 route命令詳解 在一個(gè)網(wǎng)上查找到的,和Linux下的route很類似,但有部分不一樣,汗死,開始以為是linux下的route.使用 Route 命令行工具查看并編輯計(jì)算機(jī)的 IP 路由表。Route
32、 命令和語(yǔ)法如下所示:route -f -p CommandDestination mask Netmask Gateway metric Metric if Interface-f 清除所有網(wǎng)關(guān)入口的路由表。如果該參數(shù)與某個(gè)命令組合使用,路由表將在運(yùn)行命令前清除。-p 與 add 命令一起使用時(shí)使路由具有永久性。 該參數(shù)與 add 命令一起使用時(shí),將使路由在系統(tǒng)引導(dǎo)程序之間持久存在。默認(rèn)情況下,系統(tǒng)重新啟動(dòng)時(shí)不保留路由。與 print 命令一起使用時(shí),顯示已注冊(cè)的持久路由列表。忽略其他所有總是影響相應(yīng)持久路由的命令。Command 指定您想運(yùn)行的命令 (Add/Change/Delete/P
33、rint)。路由類型:有三種路由1.主機(jī)路由從一臺(tái)主機(jī)映射一條到本地網(wǎng)絡(luò)上的的其他主機(jī)上command format:route add -host destination_ip local_ip -interface interfaceeg:我們想為本地主機(jī)接口hme0()和另一臺(tái)在相鄰才C類網(wǎng)絡(luò)上的主機(jī)(00)之間增加一條路由#route add -host 00 -interface hme02.網(wǎng)絡(luò)路由允許數(shù)據(jù)包從本地主機(jī)傳輸?shù)皆诒镜鼐W(wǎng)絡(luò)的其他主機(jī)上增加一個(gè)到另一個(gè)網(wǎng)絡(luò)的的直接路由command
34、format:route add -net destination_network_ip local_ip -netmask maskeg:如果我們要想為C類網(wǎng)掩碼在本地主機(jī)()和我們上面指出的網(wǎng)絡(luò)之間增加一條路由(網(wǎng)絡(luò))我們可以使用如下的命令:#route add -net -netmask 3.缺省路由將尋找一條路由的任務(wù)傳送到一臺(tái)路由器。RIP 和RDISC守護(hù)進(jìn)程都可以使用缺省路由。command format:route add default hostname -i
35、nterface interfaceeg:增加一條到本地路由器()的缺省路由,通常用在添加網(wǎng)關(guān)并馬上生效#route add default -interface hme1(知識(shí)若不分享 實(shí)在沒有意義 )Destination 指定該路由的網(wǎng)絡(luò)目標(biāo)。mask Netmask 指定與網(wǎng)絡(luò)目標(biāo)相關(guān)的網(wǎng)絡(luò)掩碼(也被稱作子網(wǎng)掩碼)。如果沒有指定,將使用 55Gateway 指定網(wǎng)絡(luò)目標(biāo)定義的地址集和子網(wǎng)掩碼可以到達(dá)的前進(jìn)或下一躍點(diǎn) IP 地址。metric Metric 為路由指定一個(gè)整數(shù)成本值標(biāo)(從 1 至 9999),當(dāng)在路由
36、表(與轉(zhuǎn)發(fā)的數(shù)據(jù)包目標(biāo)地址最匹配)的多個(gè)路由中進(jìn)行選擇時(shí)可以使用。if Interface 為可以訪問目標(biāo)的接口指定接口索引。就是說(shuō)發(fā)往甲的數(shù)據(jù)用接口A,發(fā)往乙的用接口B。這一條在一個(gè)網(wǎng)卡捆綁了多個(gè)同網(wǎng)段的IP時(shí)應(yīng)用非常有效。比如你捆綁 了*.1 和*.2兩個(gè)地址,你可以指定某一條主機(jī)路由是用*.1發(fā),某一條是用*.2發(fā)。不然,默認(rèn)情況下,發(fā)往同一子網(wǎng)的都是用一個(gè)IP發(fā)。若要獲得一個(gè)接口列表和它們相應(yīng)的接口索引,使用 route print 命令的顯示功能。可以使用十進(jìn)制或十六進(jìn)制值進(jìn)行接口索引。/? 在命令提示符處顯示幫助。名為 Networks 的網(wǎng)絡(luò)數(shù)據(jù)庫(kù)文件和名為 Hosts 的計(jì)算機(jī)
37、名數(shù)據(jù)庫(kù)文件中均引用全部destination 或 gateway 使用的符號(hào)名稱。如果命令是 print 或 delete,目標(biāo)和網(wǎng)關(guān)還可以使用通配符,也可以省略網(wǎng)關(guān)參數(shù)。示例若要顯示 IP 路由表的全部?jī)?nèi)容,請(qǐng)鍵入:route print若要顯示以 10. 起始的 IP 路由表中的路由,請(qǐng)鍵入:route print 10.*若要添加帶有 默認(rèn)網(wǎng)關(guān)地址的默認(rèn)路由,請(qǐng)鍵入:(知識(shí)若不分享 實(shí)在沒有意義)route add mask 若要向帶有 子網(wǎng)掩碼和 下一躍點(diǎn)地址
38、的 目標(biāo)中添加一個(gè)路由,請(qǐng)鍵入:route add mask 若要向帶有 子網(wǎng)掩碼和 下一躍點(diǎn)地址的 目標(biāo)中添加一個(gè)永久路由,請(qǐng)鍵入:route -p add mask 若要向帶有 子網(wǎng)掩碼、 下一躍點(diǎn)地址且其成本值標(biāo)為 7 的 目標(biāo)中添加一個(gè)路由,請(qǐng)鍵入:route add mask
39、 metric 7若要向帶有 子網(wǎng)掩碼、 下一躍點(diǎn)地址且使用 0x3 接口索引的 目標(biāo)中添加一個(gè)路由,請(qǐng)鍵入:route add mask if 0x3若要?jiǎng)h除到帶有 子網(wǎng)掩碼的 目標(biāo)的路由,請(qǐng)鍵入:route delete mask 若要?jiǎng)h除以 10. 起始的 IP 路由表中的所有路由,請(qǐng)鍵入:route delete 10.*若要將帶有 目標(biāo)
40、和 子網(wǎng)掩碼的下一躍點(diǎn)地址從 修改為 5,請(qǐng)鍵入:route change mask 5原文內(nèi)容: 實(shí)在沒有意義 )RouteDisplays and modifies the entries in the local IP routing table. Used without parameters, route displays help.Syntaxroute -f -p Command Destination mask Netmask Gateway metric
41、 Metric if InterfaceTop of pageParameters-f : Clears the routing table of all entries that are not host routes (routes with a netmask of 55), the loopback network route (routes with a destination of and a netmask of ), or a multicast route (routes with a destination o
42、f and a netmask of ). If this is used in conjunction with one of the commands (such as add, change, or delete), the table is cleared prior to running the command.-p : When used with the add command, the specified route is added to the registry and is used to initialize the IP rout
43、ing table whenever the TCP/IP protocol is started. By default, added routes are not preserved when the TCP/IP protocol is started. When used with the print command, the list of persistent routes is displayed. This parameter is ignored for all other commands. Persistent routes are stored in the regis
44、try location HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersPersistentRoutes.Command : Specifies the command you want to run. The following table lists valid commands.Command PurposeaddAdds a route.changeModifies an existing route.deleteDeletes a route or routes.printPrints a route
45、or routes.Destination : Specifies the network destination of the route. The destination can be an IP network address (where the host bits of the network address are set to 0), an IP address for a host route, or for the default route.(知識(shí)若不分享 實(shí)在沒有意義 )mask Netmask : Specifies the netmask (also
46、known as a subnet mask) associated with the network destination. The subnet mask can be the appropriate subnet mask for an IP network address, 55 for a host route, or for the default route. If omitted, the subnet mask 55 is used. Because of the relationship between
47、the destination and the subnet mask in defining routes, the destination cannot be more specific than its corresponding subnet mask. In other words, there cannot be a bit set to 1 in the destination if the corresponding bit in the subnet mask is a 0.Gateway : Specifies the forwarding or next hop IP a
48、ddress over which the set of addresses defined by the network destination and subnet mask are reachable. For locally attached subnet routes, the gateway address is the IP address assigned to the interface that is attached to the subnet. For remote routes, available across one or more routers, the ga
49、teway address is a directly reachable IP address that is assigned to a neighboring router.metric Metric : Specifies an integer cost metric (ranging from 1 to 9999) for the route, which is used when choosing among multiple routes in the routing table that most closely match the destination address of
50、 a packet being forwarded. The route with the lowest metric is chosen. The metric can reflect the number of hops, the speed of the path, path reliability, path throughput, or administrative properties.if Interface : Specifies the interface index for the interface over which the destination is reacha
51、ble. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the if parameter is omitted, the interfa
52、ce is determined from the gateway address./? : Displays help at the command prompt.Top of pageRemarks? Large values in the metric column of the routing table are the result of allowing TCP/IP to automatically determine the metric for routes in the routing table based on the configuration of IP addre
53、ss, subnet mask, and default gateway for each LAN interface. Automatic determination of the interface metric, enabled by default, determines the speed of each interface and adjusts the metrics of routes for each interface so that the fastest interface creates the routes with the lowest metric. To re
54、move the large metrics, disable the automatic determination of the interface metric from the advanced properties of the TCP/IP protocol for each LAN connection.? Names can be used for Destination if an appropriate entry exists in the local Networks file stored in the systemrootSystem32DriversEtc fol
55、der. Names can be used for the gateway as long as they can be resolved to an IP address through standard host name resolution techniques such as Domain Name System (DNS) queries, use of the local Hosts file stored in the systemrootsystem32driversetc folder, and NetBIOS name resolution.? If the comma
56、nd is print or delete, the Gateway parameter can be omitted and wildcards can be used for the destination and gateway. The Destination value can be a wildcard value specified by an asterisk (*). If the destination specified contains an asterisk (*) or a question mark (?), it is treated as a wildcard
57、 and only matching destination routes are printed or deleted. The asterisk matches any string, and the question mark matches any single character. For example, 10.*.1, 192.168.*, 127.*, and *224* are all valid uses of the asterisk wildcard.? Using an invalid combination of a destination and subnet mask (netmask) value displays a "Route: bad g
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 《aoe》教學(xué)課件21部編版
- 【S實(shí)驗(yàn)小學(xué)綜合樓建設(shè)項(xiàng)目投標(biāo)文件設(shè)計(jì)18000字】
- 上海紅十字考試題及答案
- 軟裝設(shè)計(jì)考試題庫(kù)及答案
- 北京放射考試題庫(kù)及答案
- 辦公中級(jí)考試題庫(kù)及答案
- 2025年醫(yī)保drg考試題目及答案
- 2025年邵陽(yáng)市北塔區(qū)區(qū)外選調(diào)教師考試模擬試題(含答案)
- 2025年創(chuàng)新型人才培養(yǎng)模式考試試題及答案
- 汽修廠烤房溫度設(shè)置與油漆固化制度
- DL∕T 1076-2017 火力發(fā)電廠化學(xué)調(diào)試導(dǎo)則
- 死亡醫(yī)學(xué)證明書填寫培訓(xùn)
- DB6101-T 3186-2024 物業(yè)服務(wù)評(píng)價(jià)技術(shù)規(guī)范
- 抖音紅娘話術(shù)
- 創(chuàng)設(shè)生活化教學(xué)與情境模擬
- 做自己的心理壓力調(diào)節(jié)師智慧樹知到期末考試答案章節(jié)答案2024年嘉興大學(xué)
- 砂石料供應(yīng)、運(yùn)輸、售后服務(wù)方案
- 2023年安徽省公務(wù)員《申論》試題及答案解析(C卷)
- 安檢設(shè)備采購(gòu)安裝調(diào)試方案
- 血糖監(jiān)測(cè)小講課ppt
- 實(shí)習(xí)生-OFFER正式通知函
評(píng)論
0/150
提交評(píng)論