LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 10-23-2017, 11:16 AM   #1
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 3,437
Blog Entries: 3

Rep: Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517
Detecting hotplugged Ethernet cables in OpenBSD


What is the best way to trigger a script when specific Ethernet interfaces go from status "no carrier" to status "active" and back again?

I'm aware of hotplugd(8) which can detect the status of some devices but not able to find how to make it aware of whether specific Ethernet cables are plugged in or not.
 
Old 10-23-2017, 11:39 AM   #2
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 158

Rep: Reputation: 53
You want ifstated(8) and ifstated.conf(5).
 
1 members found this post helpful.
Old 10-23-2017, 12:43 PM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 3,437
Blog Entries: 3

Original Poster
Rep: Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517Reputation: 1517
Sweet. That was hiding in plain sight. The manual pages hostname.if(5) and hotplugd(8) don't mention it at all. The example configuration is a great help though. Now I just have to work out the logic of having hot swappable egress without race conditions.

Last edited by Turbocapitalist; 10-23-2017 at 12:46 PM.
 
Old 10-23-2017, 01:33 PM   #4
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 158

Rep: Reputation: 53
The hotplugd(8) tool is used for device additions and removals, which occur on a bus (PCI, USB, etc.) That's a little different than a state change reported through an existing NIC.

Consider the case of a USB-attached NICs. The attach/detach of the NIC to the bus would be managed by hotplug(). The state of the network cabling attached to the NIC could be managed by ifstated().

And ifstated() can be used with external scripts so that you can manage all sorts of states. Not just a NIC's media interface.
 
  


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
LXer: How to Crimp Your Own Ethernet Cables LXer Syndicated Linux News 0 11-05-2009 12:30 AM
Question about Ethernet Cables for Gigabit MQMan Linux - Networking 11 08-19-2006 03:54 PM
two (parallel) Ethernet cables between two hosts? linux_newbie_23 Linux - Networking 4 09-15-2004 11:20 PM
connecting two PCs for file transfer via Ethernet cables jax Linux - General 4 02-22-2002 01:39 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:36 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration