I tried with
sudo ethtool -G eth0 rx 1020, but im getting this error
Cannot get device ring settings: Operation not supported. Is there any other way to change network buffer to simulate NIC card errors and Packet drops. Thanks
That's what the
netem queue discipline is for.
For outgoing traffic, just set the qdisc of the outgoing interface to netem:
modprobe sch_netem tc qdisc add dev eth0 root netem loss 3%
You can reset it to normal with
tc qdisc del dev eth0 root
For incoming traffic, the setup is a little more complicated, please check netem on incoming traffic.