Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Two host machine's one as a client and other as a server, i am testing udp load-test in these two machines.Machine Ethernet speed is 100 Mbps but i want to send 30000 packets each of 512 bytes at 1 Mbps speed how to do? Is their any Linux command to set Ethernet speed at 1 Mbps?

share|improve this question
    
See e.g. superuser.com/questions/66574/… and stackoverflow.com/questions/1094760/… for possible solutions. –  jofel Nov 6 '12 at 12:04
add comment

2 Answers 2

I use a program called iperf for any sort of network related testing (man page: http://staff.science.uva.nl/~jblom/gigaport/tools/man/iperf.html)

it has switches that allow you to set the speed. You can also run one in server mode and one in client to accurately test your network.

  -a, --tcp_bandwidth \    for TCP, bandwidth to send at in bits/sec
                  #[KM]    (default no bandwidth limit used)
  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec
                           (default 1 Mbit/sec, implies -u)
share|improve this answer
add comment

Debian GNU/Linux has ethtool and net-tools to set ethernet speed.

Example:

  • find out your NICs:
hwinfo --netcard --short
 network:                                                        
  wlp4s0               Atheros AR928X Wireless Network Adapter (PCI-Express)
  enp5s0               Broadcom NetLink BCM57780 Gigabit Ethernet PCIe
  • find out possible speeds:
ethtool enp5s0
 Settings for enp5s0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
  • you may now set all supported modes like this:
ethtool -s enp5s0 speed 100 duplex full
share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

    
Maybe add some examples of command usage? As it is this is not quite enough for an answer. –  jw013 Nov 6 '12 at 16:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.