[20201103]Martian Packets.txt
[20201103]Martian Packets.txt
--//生產系統大量出現如下資訊:
# dmesg | tail -10
[186061055.708921] ll header: 00:10:e0:57:7d:85:0c:da:41:b6:4e:07:08:00
[186061055.819286] martian source 192.168.XXX.XX from 192.168.101.10, on dev eth3
[186061055.819289] ll header: 00:10:e0:57:7d:85:0c:da:41:b6:4e:07:08:00
[186062045.645632] net_ratelimit: 6 callbacks suppressed
[186062045.645635] martian source 192.168.XXX.XX from 192.168.101.120, on dev eth3
[186062045.645637] ll header: 00:10:e0:57:7d:85:0c:da:41:b6:4e:07:08:00
[186063283.722695] martian source 192.168.XXX.XX from 10.153.248.110, on dev eth3
[186063283.722697] ll header: 00:10:e0:57:7d:85:00:23:89:a3:c9:1f:08:00
[186066674.648833] martian source 192.168.XXX.XX from 10.153.248.110, on dev eth3
[186066674.648835] ll header: 00:10:e0:57:7d:85:00:23:89:a3:c9:1f:08:00
--//實際上在連結http://blog.itpub.net/267265/viewspace-2680122/,已經出現,我已經上報給網路相關部門,可惜這麼久問題依舊。
--//團隊的許多人做事情是給領導看的,而不是認真踏實做事。我記憶裡XXX網段有外聯的路由器,也許上端或者本地的路由器設定有問題。
--//出現這種情況可能有如下可能:
經常用於駭客入侵。
可能是網路其他地方配置錯誤的伺服器的症狀。
可能表明網路基礎設施問題。
--//我估計這些IP都是外網的IP,我們內網根本沒有10.153.248.110的IP,估計透過什麼閘道器進入我們網路,而沒有回去的路由。
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.254 0.0.0.0 UG 0 0 0 bondeth0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 ib0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 ib1
169.254.0.0 0.0.0.0 255.255.128.0 U 0 0 0 ib0
169.254.128.0 0.0.0.0 255.255.128.0 U 0 0 0 ib1
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 bondeth0
192.168.XXX.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
--//按照網上介紹設定,修改/etc/sysctl.conf 檔案,修改加入如下:
net.ipv4.conf.eth3.rp_filter = 0
net.ipv4.conf.default.log_martians = 0
net.ipv4.conf.all.log_martians = 0
# sysctl -p
--//觀察看看.明天是否沒有這些資訊。
# zdate
2020/11/04 08:32:30
# tdmesg '' 10
2020-11-03 13:47:41: [186062045.645635] martian source 192.168.XXX.XX from 192.168.101.120, on dev eth3
2020-11-03 13:47:41: [186062045.645637] ll header: 00:10:e0:57:7d:85:0c:da:41:b6:4e:07:08:00
2020-11-03 14:08:19: [186063283.722695] martian source 192.168.XXX.XX from 10.153.248.110, on dev eth3
2020-11-03 14:08:19: [186063283.722697] ll header: 00:10:e0:57:7d:85:00:23:89:a3:c9:1f:08:00
2020-11-03 15:04:50: [186066674.648833] martian source 192.168.XXX.XX from 10.153.248.110, on dev eth3
2020-11-03 15:04:50: [186066674.648835] ll header: 00:10:e0:57:7d:85:00:23:89:a3:c9:1f:08:00
2020-11-03 15:47:40: [186069245.217946] martian source 192.168.XXX.XX from 192.168.101.120, on dev eth3
2020-11-03 15:47:40: [186069245.217948] ll header: 00:10:e0:57:7d:85:0c:da:41:b6:4e:07:08:00
2020-11-03 16:02:48: [186070153.032272] martian source 192.168.XXX.XX from 10.153.248.110, on dev eth3
2020-11-03 16:02:48: [186070153.032275] ll header: 00:10:e0:57:7d:85:00:23:89:a3:c9:1f:08:00
--//很明顯現在不再出現,但是這樣實際上僅僅治標而不是治本,這些資訊還是傳送到本機的。
--//實際上還可以關閉該介面,這樣比較完美解決這個問題,但是這些資訊包依舊會出現在這個網段。
--//附上tdmesg指令碼:
# cat `which tdmesg`
#! /bin/bash
FORMAT="%Y-%m-%d %T:"
now=$(date +%s)
cputime=$(grep -m1 "sched_clk" /proc/sched_debug | cut -f2 -d: )
uptime=$(grep -m1 "ktime" /proc/sched_debug | cut -f2 -d: )
# echo $now $cputime $uptime
if [ "$1" == "uptime" ] ; then
cputime=$uptime
else
cputime=$cputime
fi
dispnum=${2:-50}
#echo $dispnum
dmesg| tail -${dispnum} | while read -r line; do
offset=$( echo $line | cut -d"]" -f1 | tr -d "[")
stamp=$( echo $now - $cputime / 1000 + $offset | bc -l )
#echo "$(date -d "1970-01-01 00:00:00 UTC $stamp seconds" +"${FORMAT}") $line"
echo "$(date -d "@${stamp}" +"${FORMAT}") $line"
done
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2731989/,如需轉載,請註明出處,否則將追究法律責任。