Changing the Ethernet link speed

Discussions about using Linux guests in VirtualBox.
Post Reply
Nauroze
Posts: 2
Joined: 22. Aug 2016, 20:17

Changing the Ethernet link speed

Post by Nauroze »

Hello,

I'm trying to change the speed of the Network Adapter on a Debian guest.
The network setting is set at NAT.
I'm using the Ethtool.


If I run the command:

Code: Select all

$ ethtool eth0
I get the following result giving ethernet device properties:

Code: Select all

Settings for eth0:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: off (auto)
	Supports Wake-on: umbg
	Wake-on: d
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
Then I run the command:

Code: Select all

$ ethtool -s eth0 speed 100 autoneg off
I get the same result as before.
It is supposed to the change the speed to 100, at least that is what happens when it is run on a dedicated Linux machine, but the speed remains at 1000.
I realize this isn't the properties of the actual NIC on my machine but rather the virtualized adapter Intel PRO/1000 Desktop on virtual box. So is there a way to make this change of speed happen using Ethtool?
I know an alternative is to use VBoxManage to change the nicspeed, but I have to use Ethtool as it is part of a larger project that I need to implement this on.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Changing the Ethernet link speed

Post by mpack »

Virtual network cards have no "speed". The physical network speed is dictated by the physical connections on the host.
Nauroze
Posts: 2
Joined: 22. Aug 2016, 20:17

Re: Changing the Ethernet link speed

Post by Nauroze »

Is there any way to configure the actual NIC on the host machine through the Debian guest?
I'm developing a program containing a module that uses ethtool.h from linux libraries and sets the link speed of the NIC as part of it.
My alternative currently seems to be to use a Linux machine instead of VirtualBox, but if there is any way to configure the Network device properties through my VM it would be preferable.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Changing the Ethernet link speed

Post by mpack »

Nauroze wrote:Is there any way to configure the actual NIC on the host machine through the Debian guest?
One of the main reasons people use VMs is so things like that can't happen. A VM can only affect itself.

Yes, I understood what you wanted, but I'm afraid it isn't possible in a VM to control physical attributes (e.g. disk speed, network speed, cpu speed) unless you use the VM specific tools, e.g. to limit network bandwidth see section 6.10 of the manual.
Post Reply