Default gateways
If a TCP/IP computer needs to communicate with a host on another network, it will usually communicate through a device called a router. In TCP/IP terms, a router that is specified on a host, which links the host's subnet to other networks, is called a default gateway. This section explains how TCP/IP determines whether or not to send packets to its default gateway to reach another computer or device on the network.
When a host attempts to communicate with another device using TCP/IP, it performs a comparison process using the defined subnet mask and the destination IP address versus the subnet mask and its own IP address. The result of this comparison tells the computer whether the destination is a local host or a remote host.
If the result of this process determines the destination to be a local host, then the computer will simply send the packet on the local subnet. If the result of the comparison determines the destination to be a remote host, then the computer will forward the packet to the default gateway defined in its TCP/IP properties. It is then the responsibility of the router to forward the packet to the correct subnet.
Troubleshooting
TCP/IP network problems are often caused by incorrect configuration of the three main entries in a computer's TCP/IP properties. By understanding how errors in TCP/IP configuration affect network operations, you can solve many common TCP/IP problems.
Incorrect Subnet Mask: If a network uses a subnet mask other than the default mask for its address class, and a client is still configured with the default subnet mask for the address class, communication will fail to some nearby networks but not to distant ones. As an example, if you create four subnets (such as in the subnetting example) but use the incorrect subnet mask of 255.255.255.0 in your TCP/IP configuration, hosts will not be able to determine that some computers are on different subnets than their own. When this happens, packets destined for hosts on different physical networks that are part of the same Class C address will not be sent to a default gateway for delivery. A common symptom of this is when a computer can communicate with hosts that are on its local network and can talk to all remote networks except those that are nearby and have the same class A, B, or C address. To fix this problem, just enter the correct subnet mask in the TCP/IP configuration for that host.
Incorrect IP Address: If you put computers with IP addresses that should be on separate subnets on a local network with each other, they will not be able to communicate. They will try to send packets to each other through a router that will not be able to forward them correctly. A symptom of this problem is a computer that can talk to hosts on remote networks, but cannot communicate with some or all computers on their local network. To correct this problem, make sure all computers on the same physical network have IP addresses on the same IP subnet. If you run out of IP addresses on a single network segment, there are solutions that go beyond the scope of this article.
Incorrect Default Gateway: A computer configured with an incorrect default gateway will be able to communicate with hosts on its own network segment, but will fail to communicate with hosts on some or all remote networks. If a single physical network has more than one router, and the wrong router is configured as a default gateway, a host will be able to communicate with some remote networks, but not others. This problem is common if an organization has a router to an internal TCP/IP network and another router connected to the Internet.
默認(rèn)網(wǎng)關(guān)
如果 TCP/IP 計算機(jī)需要與另一個網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信,它通常通過稱為路由器的設(shè)備進(jìn)行通信。在 TCP/IP 術(shù)語中,主機(jī)中指定的、用于將主機(jī)子網(wǎng)鏈接到其他網(wǎng)絡(luò)的路由器稱為默認(rèn)網(wǎng)關(guān)。本節(jié)解釋 TCP/IP 如何確定是否將數(shù)據(jù)包發(fā)送到其默認(rèn)網(wǎng)關(guān)以到達(dá)網(wǎng)絡(luò)中的另一臺計算機(jī)或設(shè)備。
當(dāng)主機(jī)嘗試使用 TCP/IP 與另一個設(shè)備進(jìn)行通信時,它會使用已定義的子網(wǎng)掩碼和目標(biāo) IP 地址針對子網(wǎng)掩碼和其自己的 IP 地址進(jìn)行比較。此比較結(jié)果會告訴計算機(jī)目標(biāo)是本地主機(jī)還是遠(yuǎn)程主機(jī)。
如果此過程的結(jié)果確定目標(biāo)是本地主機(jī),則計算機(jī)只將數(shù)據(jù)包發(fā)送到本地子網(wǎng)。如果比較結(jié)果確定目標(biāo)是遠(yuǎn)程主機(jī),則計算機(jī)將數(shù)據(jù)包轉(zhuǎn)發(fā)到其 TCP/IP 屬性中定義的默認(rèn)網(wǎng)關(guān)。然后,路由器負(fù)責(zé)將數(shù)據(jù)包轉(zhuǎn)發(fā)到正確的子網(wǎng)。
疑難解答
TCP/IP 網(wǎng)絡(luò)問題通常是由計算機(jī)的 TCP/IP 屬性中三個主要條目的錯誤配置導(dǎo)致的。了解 TCP/IP 配置中的錯誤如何影響網(wǎng)絡(luò)操作后,您可以解決許多常見 TCP/IP 問題。
錯誤的子網(wǎng)掩碼:如果網(wǎng)絡(luò)將默認(rèn)掩碼外的其他子網(wǎng)掩碼用于其地址類,而客戶端仍使用該地址類的默認(rèn)子網(wǎng)掩碼進(jìn)行配置,則可以與遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信但無法與某些附近網(wǎng)絡(luò)進(jìn)行通信。例如,如果創(chuàng)建四個子網(wǎng)(例如在子網(wǎng)配置示例中),但是在 TCP/IP 配置中使用錯誤的子網(wǎng)掩碼 255.255.255.0,則主機(jī)將無法確定某些計算機(jī)是否在與它們自己的子網(wǎng)不同的子網(wǎng)中。當(dāng)發(fā)生此情況時,發(fā)送到作為相同 C 類地址一部分的不同物理網(wǎng)絡(luò)中的主機(jī)的數(shù)據(jù)包將不會發(fā)送到默認(rèn)網(wǎng)關(guān)來進(jìn)行傳送。此問題的常見癥狀是計算機(jī)可以與其本地網(wǎng)絡(luò)中的主機(jī)以及所有遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信,但無法與位置在附近并具有相同的 A、B 或 C 類地址的網(wǎng)絡(luò)進(jìn)行通信。要解決此問題,只需在該主機(jī)的 TCP/IP 配置中輸入正確的子網(wǎng)掩碼。
錯誤的 IP 地址:如果將那些 IP 地址在本地網(wǎng)絡(luò)的不同子網(wǎng)中的計算機(jī)放在一起,則它們無法進(jìn)行通信。它們會嘗試通過路由器相互發(fā)送數(shù)據(jù)包,而該路由器卻無法正確轉(zhuǎn)發(fā)這些數(shù)據(jù)包。此問題的癥狀是計算機(jī)可以與遠(yuǎn)程網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信,但是無法與其本地網(wǎng)絡(luò)中的某些或全部計算機(jī)通信。要解決此問題,請確保同一物理網(wǎng)絡(luò)中的所有計算機(jī)具有同一 IP 子網(wǎng)中的 IP 地址。如果一個網(wǎng)段中的 IP 地址已用完,還可使用一些解決方案進(jìn)行處理,但已超出本文范圍。
錯誤的默認(rèn)網(wǎng)關(guān):使用錯誤的默認(rèn)網(wǎng)關(guān)配置的計算機(jī)能夠與其自己網(wǎng)段中的主機(jī)進(jìn)行通信,但是無法與某些或全部遠(yuǎn)程網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信。如果一個物理網(wǎng)絡(luò)有多個路由器,且將錯誤的路由器配置為默認(rèn)網(wǎng)關(guān),則主機(jī)能夠與某些遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信,但是無法與其他遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信。如果組織中有一個路由器連接到內(nèi)部 TCP/IP 網(wǎng)絡(luò),另一個路由器連接到 Internet,則此問題很常見。
If a TCP/IP computer needs to communicate with a host on another network, it will usually communicate through a device called a router. In TCP/IP terms, a router that is specified on a host, which links the host's subnet to other networks, is called a default gateway. This section explains how TCP/IP determines whether or not to send packets to its default gateway to reach another computer or device on the network.
When a host attempts to communicate with another device using TCP/IP, it performs a comparison process using the defined subnet mask and the destination IP address versus the subnet mask and its own IP address. The result of this comparison tells the computer whether the destination is a local host or a remote host.
If the result of this process determines the destination to be a local host, then the computer will simply send the packet on the local subnet. If the result of the comparison determines the destination to be a remote host, then the computer will forward the packet to the default gateway defined in its TCP/IP properties. It is then the responsibility of the router to forward the packet to the correct subnet.
Troubleshooting
TCP/IP network problems are often caused by incorrect configuration of the three main entries in a computer's TCP/IP properties. By understanding how errors in TCP/IP configuration affect network operations, you can solve many common TCP/IP problems.
Incorrect Subnet Mask: If a network uses a subnet mask other than the default mask for its address class, and a client is still configured with the default subnet mask for the address class, communication will fail to some nearby networks but not to distant ones. As an example, if you create four subnets (such as in the subnetting example) but use the incorrect subnet mask of 255.255.255.0 in your TCP/IP configuration, hosts will not be able to determine that some computers are on different subnets than their own. When this happens, packets destined for hosts on different physical networks that are part of the same Class C address will not be sent to a default gateway for delivery. A common symptom of this is when a computer can communicate with hosts that are on its local network and can talk to all remote networks except those that are nearby and have the same class A, B, or C address. To fix this problem, just enter the correct subnet mask in the TCP/IP configuration for that host.
Incorrect IP Address: If you put computers with IP addresses that should be on separate subnets on a local network with each other, they will not be able to communicate. They will try to send packets to each other through a router that will not be able to forward them correctly. A symptom of this problem is a computer that can talk to hosts on remote networks, but cannot communicate with some or all computers on their local network. To correct this problem, make sure all computers on the same physical network have IP addresses on the same IP subnet. If you run out of IP addresses on a single network segment, there are solutions that go beyond the scope of this article.
Incorrect Default Gateway: A computer configured with an incorrect default gateway will be able to communicate with hosts on its own network segment, but will fail to communicate with hosts on some or all remote networks. If a single physical network has more than one router, and the wrong router is configured as a default gateway, a host will be able to communicate with some remote networks, but not others. This problem is common if an organization has a router to an internal TCP/IP network and another router connected to the Internet.
默認(rèn)網(wǎng)關(guān)
如果 TCP/IP 計算機(jī)需要與另一個網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信,它通常通過稱為路由器的設(shè)備進(jìn)行通信。在 TCP/IP 術(shù)語中,主機(jī)中指定的、用于將主機(jī)子網(wǎng)鏈接到其他網(wǎng)絡(luò)的路由器稱為默認(rèn)網(wǎng)關(guān)。本節(jié)解釋 TCP/IP 如何確定是否將數(shù)據(jù)包發(fā)送到其默認(rèn)網(wǎng)關(guān)以到達(dá)網(wǎng)絡(luò)中的另一臺計算機(jī)或設(shè)備。
當(dāng)主機(jī)嘗試使用 TCP/IP 與另一個設(shè)備進(jìn)行通信時,它會使用已定義的子網(wǎng)掩碼和目標(biāo) IP 地址針對子網(wǎng)掩碼和其自己的 IP 地址進(jìn)行比較。此比較結(jié)果會告訴計算機(jī)目標(biāo)是本地主機(jī)還是遠(yuǎn)程主機(jī)。
如果此過程的結(jié)果確定目標(biāo)是本地主機(jī),則計算機(jī)只將數(shù)據(jù)包發(fā)送到本地子網(wǎng)。如果比較結(jié)果確定目標(biāo)是遠(yuǎn)程主機(jī),則計算機(jī)將數(shù)據(jù)包轉(zhuǎn)發(fā)到其 TCP/IP 屬性中定義的默認(rèn)網(wǎng)關(guān)。然后,路由器負(fù)責(zé)將數(shù)據(jù)包轉(zhuǎn)發(fā)到正確的子網(wǎng)。
疑難解答
TCP/IP 網(wǎng)絡(luò)問題通常是由計算機(jī)的 TCP/IP 屬性中三個主要條目的錯誤配置導(dǎo)致的。了解 TCP/IP 配置中的錯誤如何影響網(wǎng)絡(luò)操作后,您可以解決許多常見 TCP/IP 問題。
錯誤的子網(wǎng)掩碼:如果網(wǎng)絡(luò)將默認(rèn)掩碼外的其他子網(wǎng)掩碼用于其地址類,而客戶端仍使用該地址類的默認(rèn)子網(wǎng)掩碼進(jìn)行配置,則可以與遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信但無法與某些附近網(wǎng)絡(luò)進(jìn)行通信。例如,如果創(chuàng)建四個子網(wǎng)(例如在子網(wǎng)配置示例中),但是在 TCP/IP 配置中使用錯誤的子網(wǎng)掩碼 255.255.255.0,則主機(jī)將無法確定某些計算機(jī)是否在與它們自己的子網(wǎng)不同的子網(wǎng)中。當(dāng)發(fā)生此情況時,發(fā)送到作為相同 C 類地址一部分的不同物理網(wǎng)絡(luò)中的主機(jī)的數(shù)據(jù)包將不會發(fā)送到默認(rèn)網(wǎng)關(guān)來進(jìn)行傳送。此問題的常見癥狀是計算機(jī)可以與其本地網(wǎng)絡(luò)中的主機(jī)以及所有遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信,但無法與位置在附近并具有相同的 A、B 或 C 類地址的網(wǎng)絡(luò)進(jìn)行通信。要解決此問題,只需在該主機(jī)的 TCP/IP 配置中輸入正確的子網(wǎng)掩碼。
錯誤的 IP 地址:如果將那些 IP 地址在本地網(wǎng)絡(luò)的不同子網(wǎng)中的計算機(jī)放在一起,則它們無法進(jìn)行通信。它們會嘗試通過路由器相互發(fā)送數(shù)據(jù)包,而該路由器卻無法正確轉(zhuǎn)發(fā)這些數(shù)據(jù)包。此問題的癥狀是計算機(jī)可以與遠(yuǎn)程網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信,但是無法與其本地網(wǎng)絡(luò)中的某些或全部計算機(jī)通信。要解決此問題,請確保同一物理網(wǎng)絡(luò)中的所有計算機(jī)具有同一 IP 子網(wǎng)中的 IP 地址。如果一個網(wǎng)段中的 IP 地址已用完,還可使用一些解決方案進(jìn)行處理,但已超出本文范圍。
錯誤的默認(rèn)網(wǎng)關(guān):使用錯誤的默認(rèn)網(wǎng)關(guān)配置的計算機(jī)能夠與其自己網(wǎng)段中的主機(jī)進(jìn)行通信,但是無法與某些或全部遠(yuǎn)程網(wǎng)絡(luò)中的主機(jī)進(jìn)行通信。如果一個物理網(wǎng)絡(luò)有多個路由器,且將錯誤的路由器配置為默認(rèn)網(wǎng)關(guān),則主機(jī)能夠與某些遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信,但是無法與其他遠(yuǎn)程網(wǎng)絡(luò)進(jìn)行通信。如果組織中有一個路由器連接到內(nèi)部 TCP/IP 網(wǎng)絡(luò),另一個路由器連接到 Internet,則此問題很常見。