Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-15-2012, 09:46 AM   #1
Registered: Jun 2005
Location: Seattle, Ecotopia
Distribution: CentOS 7.4 with KDE
Posts: 245

Rep: Reputation: 20
Script on NIC Up - Doesn't Work

Does anyone know why execution of a script when a network interface comes up, doesn't work?

I have this in /etc/network/if-up.d

# Don't run sshcygnus while bringing up the loopback or eth0 device;
# it's not necessary until we bring up wlan0
[ "$IFACE" = "lo" ] || exit 0
[ "$IFACE" = "eth0" ] || exit 0
echo "sshcygnus0" >/var/log/messages

if [ -x /usr/local/bin/sshcygnus ] ; then
echo "sshcygnus1" >/var/log/messages
  exec /usr/local/bin/sshcygnus
echo "sshcygnus2" >/var/log/messages

Old 01-15-2012, 01:36 PM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
What distro are you using? I use Fedora 15, and this is how my system is setup:
[root@ltp01 network-scripts]# pwd
[root@ltp01 network-scripts]# ls -a
.                     ifcfg-em1              ifdown       ifdown-ipsec  ifdown-ppp     ifup          ifup-ippp   ifup-isdn   ifup-ppp     ifup-wireless        keys-wrt350nmodv101a
..                    ifcfg-lo               ifdown-bnep  ifdown-ipv6   ifdown-routes  ifup-aliases  ifup-ipsec  ifup-plip   ifup-routes  init.ipv6-global     net.hotplug
ifcfg-DJRcomputing    ifcfg-wlan0            ifdown-eth   ifdown-isdn   ifdown-sit     ifup-bnep     ifup-ipv6   ifup-plusb  ifup-sit     keys-DJRcomputing    network-functions
ifcfg-donna-wireless  ifcfg-wrt350nmodv101a  ifdown-ippp  ifdown-post   ifdown-tunnel  ifup-eth      ifup-ipx    ifup-post   ifup-tunnel  keys-donna-wireless  network-functions-ipv6
[root@ltp01 network-scripts]#
Old 01-19-2012, 11:23 AM   #3
Registered: Jun 2005
Location: Seattle, Ecotopia
Distribution: CentOS 7.4 with KDE
Posts: 245

Original Poster
Rep: Reputation: 20
Using Debian. Unfortunately Fedora is quite different.

After more testing, it appears that these two lines are at fault:
[ "$IFACE" = "lo" ] || exit 0
[ "$IFACE" = "eth0" ] || exit 0

When I comment them out, the script then runs.

It doesn't make sense, as the script is run for each interface. When I shut down wlan0 and bring it back up, lo and eth0 are not being brought up. wlan0 should be the interface in $IFACE.

Also, when running it tries to set up reverse tunnels for IPP (port 631) but fails with 'no route to host'. Only subsequent tunnels show the normal setup, including MythTV, Squid, and MySQL. I guess this is because of the delay in association of the wlan interface with the router, although I put a wait 3 at the beginning of the tunnel script and it didn't help. So it's a mystery...

Last edited by Quantumstate; 01-19-2012 at 01:16 PM.


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 doesn't save settings. Debian 5.0 used to work until update joebpa Debian 1 07-07-2009 08:49 AM
new NIC doesn't work in Linux FC3? trien27 Linux - Networking 1 07-30-2007 01:37 AM
My NIC doesn't seem to work... kenneth_phough Linux - Laptop and Netbook 1 06-18-2006 09:32 PM
FC2 - NIC doesn't work - slows down my pc benjin Linux - Networking 4 08-13-2004 07:16 PM
PCMCIA NIC doesn't work any more X11 Linux - Hardware 1 07-21-2002 06:20 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:14 AM.

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