How to use netem/tc to simulate a bad network (drop and delay packets) for a single IP address (not NIC)?

一曲冷凌霜 提交于 2019-12-08 07:39:11

问题


Looking at the below diagram, how to use netem/tc to drop 10% of packets and delay them by 2ms for a single IP?

  +----------------+                                                      
  |                |                                                      
  |   Test Client  |--------------+                                       
  |  148.341.10.15 |              |                                       
  +----------------+              |            +----------------+         
                                  |            |                |         
                                  |------------|     Server     |         
                                  |            |                |         
  +----------------+              |            +----------------+         
  |                |              |                                       
  | Normal Cleints |--------------+                                       
  |                |                                                      
  +----------------+                                                  

From researching it should be possible however this looks to be more complex use case (as usually it is done on the interface and not IP level).

This answer is excellent however only deals with the NIC level, as does the netem documentation

I found an article which appears to be doing it on an IP level however it is quite complex.

Note that the IP address in the diagram below is a sample IP only.

How to use netem/tc to drop 10% of packets to/from 148.341.10.15 and delay them by 2ms?

来源:https://stackoverflow.com/questions/46945705/how-to-use-netem-tc-to-simulate-a-bad-network-drop-and-delay-packets-for-a-sin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!