Hard set ethernet port speed

Report wireless and/or network connectivity problems in this forum.

Moderator: Moderators

Post Reply
dsalch
Posts: 127
Joined: Wed Jan 06, 2016 2:09 pm
Location: Tx

Hard set ethernet port speed

Post by dsalch »

I am using the TP-LINK Archer C7 v5 and have need to hard set the ethernet port speed for one port. Browsing through the forums both here and on openwrt, IT seems that SWCONFIG should do it. But whenever I try, I get an error that :

Failed to set attribute: Operation not supported

Is there another way?

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Hard set ethernet port speed

Post by Lantis »

swconfig is the right way to do it. It may be that a specific parameter you’re trying to set isn’t supported.
What commands have you tried?
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

dsalch
Posts: 127
Joined: Wed Jan 06, 2016 2:09 pm
Location: Tx

Re: Hard set ethernet port speed

Post by dsalch »

I tried a wide variety, here is an excerpt:

oot@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "speed:10baseT full-duplex txflow rxflow"
Unsupported option speed:10baseT
Unsupported option full-duplex
Unsupported option txflow
Unsupported option rxflow
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "speed:10baseT"
Unsupported option speed:10baseT
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "speed 100baseT"
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "100baseT"
Unsupported option 100baseT
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "speed"
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config#
root@Gargoyle:/etc/config#
root@Gargoyle:/etc/config#
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "duplex full speed 100 autoneg off"
Failed to set attribute: Operation not supported
root@Gargoyle:/etc/config# swconfig dev switch0 port 4 set link "speed 100"
Failed to set attribute: Operation not supported

dsalch
Posts: 127
Joined: Wed Jan 06, 2016 2:09 pm
Location: Tx

Re: Hard set ethernet port speed

Post by dsalch »

Does this help?

oot@Gargoyle:~# swconfig dev switch0 port 1 help
switch0: ag71xx-mdio.0(Atheros AR8337), ports: 7 (cpu @ 0), vlans: 128
--switch
Attribute 1 (int): enable_vlan (Enable VLAN mode)
Attribute 2 (none): reset_mibs (Reset all MIB counters)
Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX packets)
Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX packets)
Attribute 5 (int): mirror_monitor_port (Mirror monitor port)
Attribute 6 (int): mirror_source_port (Mirror source port)
Attribute 7 (int): arl_age_time (ARL age time (secs))
Attribute 8 (string): arl_table (Get ARL table)
Attribute 9 (none): flush_arl_table (Flush ARL table)
Attribute 10 (int): igmp_snooping (Enable IGMP Snooping)
Attribute 11 (int): igmp_v3 (Enable IGMPv3 support)
Attribute 12 (none): apply (Activate changes in the hardware)
Attribute 13 (none): reset (Reset the switch)
--vlan
Attribute 1 (int): vid (VLAN ID (0-4094))
Attribute 2 (ports): ports (VLAN port mapping)
--port
Attribute 1 (none): reset_mib (Reset single port MIB counters)
Attribute 2 (string): mib (Get port's MIB counters)
Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode)
Attribute 4 (none): flush_arl_table (Flush port's ARL table entries)
Attribute 5 (int): igmp_snooping (Enable port's IGMP Snooping)
Attribute 6 (int): vlan_prio (Port VLAN default priority (VLAN PCP) (0-7))
Attribute 7 (int): pvid (Primary VLAN ID)
Attribute 8 (unknown): link (Get port link information)

dsalch
Posts: 127
Joined: Wed Jan 06, 2016 2:09 pm
Location: Tx

Re: Hard set ethernet port speed

Post by dsalch »

The link runs reliably with no errors at 10MBPS and occasioanlly it will auto negotiate for 100 at startup, for a very short time, then falls back to 10. I was hoping to hard set both ends to 100 full and disable the auto negotiate.

This is a link between two routers, across a buried ethernet cable about 50 yards long. When we first installed the link (with different routers) it ran at 100, but now it always falls back to 10 after even a few seconds of traffic (if it comes up at 100 at all).

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Hard set ethernet port speed

Post by Lantis »

Run this

Code: Select all

swconfig dev switch0 port X get link
Where X is the port number for the ethernet port you want. Note that it is not always a 1:1 mapping, so you may need to experiment to figure it out.
If you look at /etc/board.json, the "index" is the physical port number, and the "num" is the swconfig switch port number. Index isn't mandatory so again it might take some guesswork.

Once you are sure you're working with the right port number.

Code: Select all

swconfig dev switch0 port X set link "duplex half speed 100 autoneg off"
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

dsalch
Posts: 127
Joined: Wed Jan 06, 2016 2:09 pm
Location: Tx

Re: Hard set ethernet port speed

Post by dsalch »

Unfortunately, still says "operation not supported"

oot@Gargoyle:~# swconfig dev switch0 port 3 show
Port 3:
mib: MIB counters
RxBroad : 341253
RxPause : 0
RxMulti : 157000
RxFcsErr : 0
RxAlignErr : 0
RxRunt : 0
RxFragment : 0
Rx64Byte : 1256392
Rx128Byte : 680716
Rx256Byte : 77643
Rx512Byte : 85377
Rx1024Byte : 74509
Rx1518Byte : 114657
RxMaxByte : 0
RxTooLong : 0
RxGoodByte : 406128106 (387.3 MiB)
RxBadByte : 0
RxOverFlow : 0
Filtered : 0
TxBroad : 40045
TxPause : 0
TxMulti : 4167
TxUnderRun : 0
Tx64Byte : 181206
Tx128Byte : 417665
Tx256Byte : 46950
Tx512Byte : 40868
Tx1024Byte : 37476
Tx1518Byte : 628892
TxMaxByte : 0
TxOverSize : 0
TxByte : 966041738 (921.2 MiB)
TxCollision : 0
TxAbortCol : 0
TxMultiCol : 0
TxSingleCol : 0
TxExcDefer : 0
TxDefer : 0
TxLateCol : 0

enable_eee: 0
igmp_snooping: 0
vlan_prio: 0
pvid: 1
link: port:3 link:up speed:10baseT full-duplex txflow rxflow auto
root@Gargoyle:~# swconfig dev switch0 port 3 set link "duplex half speed 100 autoneg off"
Failed to set attribute: Operation not supported
root@Gargoyle:~# swconfig dev switch0 port 3 set link "duplex full speed 100 autoneg off"
Failed to set attribute: Operation not supported
root@Gargoyle:~#

Lantis
Moderator
Posts: 6920
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Hard set ethernet port speed

Post by Lantis »

No idea sorry. You can try asking for more advice at the openwrt forum (include some of the things already tried).
For what it’s worth, sounds like your buried cable might be on its last legs :(
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply