[20191216]route妙用.txt
[20191216]route妙用.txt
--//使用route add -host ip_address reject,可以拒接某臺機器的連線.自己做一個測試:
1.顯示路由表:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.XXX 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
2.改寫路由表:
# route add -host 192.168.100.40 reject
3.測試:
# ping 192.168.100.40
connect: Network is unreachable
--//從192.168.100.40操作看看:
# ping 192.168.100.78 -c 2
PING 192.168.100.78 (192.168.100.78) 56(84) bytes of data.
From 192.168.100.40 icmp_seq=0 Destination Host Unreachable
From 192.168.100.40 icmp_seq=1 Destination Host Unreachable
--- 192.168.100.78 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
, pipe 2
4.顯示路由表:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.XXX 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.100.40 - 255.255.255.255 !H 0 - 0 -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--//這樣就無法ping連線192.168.100.40.
Flags Possible flags include
U route is up
H target is a host
G use gateway
R reinstate route for dynamic routing
D dynamically installed by daemon or redirect
M modified from routing daemon or redirect
A installed by addrconf
C cache entry
! reject route
5.測試還原:
# route del -host 192.168.100.40 reject
# ping 192.168.100.40 -c 2
PING 192.168.100.40 (192.168.100.40) 56(84) bytes of data.
64 bytes from 192.168.100.40: icmp_seq=1 ttl=64 time=0.109 ms
64 bytes from 192.168.100.40: icmp_seq=2 ttl=64 time=0.137 ms
--- 192.168.100.40 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.109/0.123/0.137/0.014 ms
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2668955/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20191216]共享池繫結變數的值在哪裡2.txt變數
- 路由 Route路由
- №20191216簡易操作1~7(今期:上=下=14)
- git 妙用Git
- setTimeout妙用
- next-route
- vue-routeVue
- Laravel7.0 Route::get ()->name ('home') route ('home') 報錯Laravel
- 3.3.1 - Laravel - 5.6 - Route - 路由物件Route的建立過程Laravel路由物件
- 使用 Route macro 來定義 Route 的新方法Mac
- ActionChains 的妙用AI
- reduce的妙用
- laravel8 routeLaravel
- Flink狀態妙用
- Go channel 的妙用Go
- hr標籤妙用
- 3.3 - Laravel - 5.6 - Route - 載入單個Route例項的主要流程Laravel
- Sanic route() 方法/函式函式
- Express route 原始碼解析Express原始碼
- 二分的妙用
- html <a>標籤的妙用HTML
- 責任鏈模式妙用模式
- Linux:“awk”命令的妙用Linux
- 妙用ConstraintLayout的Circular positioningAI
- Vue 小API大妙用VueAPI
- IntegerCache的妙用和陷阱
- MacBook上的touchid妙用Mac
- 3.1 - Laravel - 5.6 - Route - Group方法Laravel
- Flutter中的Navigator和RouteFlutter
- Postman小工具大妙用Postman
- excel妙用之VLOOKUP函式Excel函式
- Go sync.Once 的妙用Go
- Fastjson妙用之@JSONField註解ASTJSON
- C++中const的妙用C++
- typescript:never與keyof的妙用TypeScript
- KeyPath在Swift中的妙用Swift
- Javascript裝飾器的妙用JavaScript
- PHP 陣列函式妙用PHP陣列函式