How hosts with no IP address maintain IP tier connectivity

Source: Internet
Author: User

In the "two different network segments of the PC direct connection can ping each other" article, I am a bit like playing heterodoxy, this article, I continue to be obsessed. Two machines, M1 and M2, each with a NIC eth0, configured as follows:
configuration of the M1:
No IP address is configured on the eth0.
configuration of the M2:
No IP address is configured on the eth0.
....
Explosion, there is no IP address on the machine, through a ball of yarn!!
I just want to elaborate a common sense in 7 years, that is, routing is fundamental. In 2010, 7 years ago, I wrote an article on the issue of inter-IP network visits-routing is fundamental, in the previous period, I wrote a similar "two different network segments of the PC direct connection can ping each other", 7 years, as if no progress, in addition to the article layout good-looking, alas, is also intoxicated, But it doesn't prevent me from further.
I still want to use the M1 1.1.1.1来 Ping M2 2.2.2.2, but do not configure the two addresses on M1 and M2, what to do? Very simple, configure routing. The configuration is as follows:
configuration of the M1:
IP route add local 1.1.1.1/32 Dev eth0
IP route add 2.2.2.2/32 dev eth0 scope link or IP route add 2.2.2.2/32 via 2.2.2.2 dev eth0 onlink

configuration of the M2:
IP route add local 2.2.2.2/32 Dev eth0
IP route add 1.1.1.1/32 dev eth0 scope link or IP route add 1.1.1.1/32 via 2.2.2.2 dev eth0 onlink

Try it, ping 2.2.2.2 in M1, and enjoy the exchange.
See, there is no IP address configured, only the routing can be interoperable, in the above configuration, the local route indicates which packets are received natively, while the Onlink route can be directly ARP target. Two routes are very well understood.
If you are forwarding a device, do you need a local route? The answer is needed. Perhaps you would ask, as a forwarding device, no packet to the local Ah, why also local route it? It's right to understand that, but you ignore ARP.
However, if your link layer is not Ethernet, but a point-to Noarp link, then as a forwarding device, the local route is no longer required.
--------------------
After reading this example, you may ask, what is the meaning of the IP address? Honestly, the meaning of the IP address is only two points:
1. Identify the node.
2. Create several route entries for the node that configures the IP:
2.1. Identify its own local route;
2.2. Identify the broadcast route of the subnet;
2.3. Link-layer routing that identifies the link, that is, the scope link route;

Did you see it? If you do not need to identify the host, just to communicate, then when you can manually configure the above three routes, you do not need an IP address at all.
--------------------
In fact, IP routing this thing, there is not much knowledge in the inside, the key to see how to play. High-end play, you can engage in algorithms, to engage in the shortest path, build tree What, in the end of the game can play the protocol, BGP,IS-IS,OSPF what the mastery is also enough to install force, Dick Silk Point, like me, toss the next edge point of things, to help see my article out of the point of the abnormal point of the face test, it is very Ha ha.
Having said so much, the route is fundamental! TCP listener does not show bind how do I know which address of bind? by routing. How does the UDP message populate the source address? by routing. How does ARP work? By route ...

Wenzhou leather shoes, rain water will not be fat! O ' Connell, Gilda, Red Dragonfly, Nissin, Sun, Whit, Spider King, Kang Nai, Annunciation Bird, these Wenzhou leather shoes brand, you all understand? Do you cross? Will you wear it?


Add:
On M1, if you typed the configuration as follows:
IP route add 20.2.2.2/32 via 4.4.4.4 Dev eth0
What's going to happen? It is clear that the network will not be reached. How to solve? First you need to know why the network is unreachable? It is clear that the system does not know where 4.4.4.4, and you want to let 4.4.4.4 become 20.2.2.2 to the next jump, it must be on the M1 link, so good, with a link to the 4.4.4.4 to the route can:
IP route add 4.4.4.4/32 dev eth0 scope link
Next, continue to configure the IP route add 20.2.2.2/32 via 4.4.4.4 dev eth0and you will see your smile.
Want to communicate, the route is fundamental!

--------------------
7 years ago, on the question of mutual visits between IP networks-routing is fundamental, there was a comment, asking a question:
Doesn't arp call the link layer directly? For M1, even if you do not set the route to M2, you should also answer the M2 sent out the ARP parsing request ah. But by grasping the bag to see M1 did not answer, this is why?
It was not until a few days ago that I saw and gave the answer, and estimated that the question would not be seen again, so I posted my answer:
The rp_filter of the NIC that M1 received the M2 ARP request is configured to 0 to reply to the ARP request of M2.

How hosts with no IP address can keep the IP tier connected

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.