Do you have any code/library/etc on howa c program can get the IP
Address of the user running the code in Solaris? SunOS?
I'd like to use tc and netem to cause network delay, but only to
certain other machines.
I found this page which (apparently) describes how to do it:
I can get outgoing network delay using:
tc qdisc add dev eth0 root netem delay 200ms
but this adds latency to all outbound traffic.
Further down the page I linked to above, it mentions how to delay to
only one IP address and gives the following code:
tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:3 handle 30: netem \
delay 200ms 10ms distribution normal
tc qdisc add dev eth0 parent 30:1 tbf rate 20kbit buffer 1600 limit
tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 \
match ip dst 22.214.171.124/32 flowid 10:3
However, when I've tried this, I get network delay to all ip addresses
- I can't seem to filter to just one ip address.
Does anyone know the solution?