LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2014, 12:37 PM   #1
watkinb
LQ Newbie
 
Registered: Jan 2014
Location: Virginia
Distribution: Fedora 2, Scientific Linux 6, PCLinuxOS, Mandrake 10.1, Whatever else I can play with.
Posts: 13

Rep: Reputation: 1
Set negotiation/duplex and make permanent with unmanaged interfaces. (no net mgr)


The machine I'm working on is running Fedora 14 and has 24 fiber optic network interfaces.

The interfaces are configured at boot time with a custom script in rc.local. This is a test machine, so changing scenarios call for different port configurations that change sometimes between boots, which the rc.local script handles, so I'm not using Network Manager (in fact, the service is disabled).


The problem is that for some reason the ports are autonegotiating duplex incorrectly. I modified the rc.local script to add something like:

Code:
ethtool -s eth$ethNumber autoneg off duplex full
The other connections are set to 100MB Full, but on the Linux machine, they negotiate to half and I start seeing errors. If I manually set them to full, the errors stop.

This script modification worked fine until I ran into a situation where if a link is down, ethtool won't configure it and leaves it at the default Autonegotiation. If/when the link finally comes up, it doesn't negotiate to the proper duplex.

Enabling Network Manager so it uses network-scripts is the only way I know of to ensure that the links come up in proper duplex every time, but it means that I'll have to manually edit the other configuration for each network interface each time our test setup changes.

By the way, I'm talking about just one of two identical computers, which means I'd have to manually configure 28 NICs each time the test setup changes.

The only other thing I can think of is to figure out a script to manually edit all of the ifcfg files with the changes I need, but that's beyond my scripting level at the moment.
 
Old 01-23-2014, 04:02 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

Rep: Reputation: 163Reputation: 163
It is better to configure speed option when the issue come out.

Execute "ethtool -s eth$ethNumber autoneg off duplex full"
Or edit /etc/sysconfig/network-scripts/ifcfg-ethX file for ethX interface, X is Ethernet interface number. And the adding following line, ETHTOOL_OPTS="speed 1000 duplex full autoneg off".

To make configuration active, network has to be restart.
Execute "/etc/init.d/network restart"
 
Old 01-24-2014, 05:54 AM   #3
watkinb
LQ Newbie
 
Registered: Jan 2014
Location: Virginia
Distribution: Fedora 2, Scientific Linux 6, PCLinuxOS, Mandrake 10.1, Whatever else I can play with.
Posts: 13

Original Poster
Rep: Reputation: 1
Well, as my post above said, I needed them to be able to be configured either while the link was down, or somehow be able to remember the configuration settings when the link eventually comes up. It's part of an automated test system, so having to reconfigure the ports manually if/when they come up isn't what's needed.

Also, since we have Network Manager disabled, would the scripts in /etc/sysconfig/network-scripts/ifcfg-ethx even be executed?

Anyway, just wanted to update that thanks to a couple of Linux hackers at work, I came up with another solution that is basically a simple script, scheduled to run every 30 seconds with the help of cron (two entries for the script, the second one adding a "sleep 30;" ahead of the path to the same script) that checks each interfaces' link detection state, then configures the interface if needed.
 
Old 01-24-2014, 03:36 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

Rep: Reputation: 163Reputation: 163
The /etc/sysconfig/network-scripts/ifcfg-ethX is ethX configuration file. It can't be executed but network module read it during network starting.
If you want to use it during following two cases, it is better to edit /etc/sysconfig/network-scripts/ifcfg-ethX file and restart network.
1)On fly while the link was down.
2)Remember the configuration settings.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NIC-Duplex-Negotiation jnreddy Linux - Server 5 03-20-2011 11:50 PM
what is the command to get network interface index, speed, duplex and negotiation? pvkdevi Linux - Networking 1 11-24-2009 04:25 AM
Make duplex settings permanent? rgates Linux - Networking 1 03-07-2006 04:22 PM
making WiFi settings in /etc/network/interfaces permanent Lleb_KCir Linux - General 3 05-11-2005 12:22 AM
net.ipv4.tcp_syn_retries - how to make change permanent syx Linux - Networking 1 01-05-2005 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration