- 论坛徽章:
- 0
|
arplookup failed host is not on local network
This is a netmask problem, but not really the one that other people
have described. This is how it usually works. Your troubled machine
above, "servername," receives an ARP who-has from another machine on
the LAN called "clientname." However, the IP address that clientname
gives as a source does not match up to any local networks that
servername knows about.
For example, say servername has an address of 192.0.2.10/25. The other
machine has 192.0.2.210/24. When servername gets an ARP (which is
broadcast so servername gets it fine),
who-has 192.0.2.10 tell 192.0.2.210
It gets confused. 192.0.2.210 is not local (as far as it is concerned)
so it logs an error.
Note that this is not a harmless error. These two machine cannot talk
to each other.
The fix, of course, is to make sure all machines on the same LAN have
the same netmask.
===============================================
我們先看看這問題出在那兒:
ARP 在正常使用時是只在同一subnet中跑而已, 而且, IP nodes只會對Destination
Protocol Address 是自己的Address之ARP作處理.
所以當Subnet 中每一部機器都正確地Configure, 且機器正確implement ARP protocol時,
every thing is all right....呵呵~
問題會產生的架構應為 一個router interface接兩(或以上)個subnet的情況:
(我用sniffer看, 再參考if_ether.c 歸納之):
+--------+
---| Router |----------a.b.c.0/24
| | a.b.e.0/24
+--------+
一個router interface接兩個subnet:
正常情況底下, a.b.c.? 要與 a.b.e.? 通訊是要透過ROUTER.
這時候, 如果有一部a.b.e.x的mask是用/16而非/24, 那它要與a.b.c.y通訊時,
會直接送ARP Request給a.b.c.y而非ROUTER, a.b.c.y會回ARP Reply及檢
查本身的ARP table(要做reflesh, update等), 一檢查就發現a.b.e.x不在同一sunet,
那
arplookup a.b.e.x failed: host is not on local network
就出來了, 呵~
解決方法:1.給a.b.e.x正確的subnet mask(治本), 如果a.b.e.x是別人家的,就.....
2.我建議把這個message
完全弄掉:
/sys/netinet/if_ether.c
arplookup(...) 之這一後:
if (rt->;rt_flags & RTF_GATEWAY)
why = "host is not on local network"
else if ((rt->;rt_flags & RTF_LLINFO) == 0)
why = "could not allocate llinfo"
else if (rt->;rt_gateway->;sa_family != AF_LINK)
why = "gateway route is not ours"
改為:
if (rt->;rt_flags & RTF_GATEWAY){
// why = "host is not on local network"
return 0;
}
else if ((rt->;rt_flags & RTF_LLINFO) == 0)
why = "could not allocate llinfo"
else if (rt->;rt_gateway->;sa_family != AF_LINK)
why = "gateway route is not ours"
這麼一來, 人人通用囉..... |
|