LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-13-2016, 06:47 PM   #1
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Multiple IP Addresses on network device - Where to report bugs?


I ran into a couple of problems with the network startup and shutdown scripts dealing with multiple IP addresses on a network device.

With some minor changes to the network scripts I was able to get the problems resolved. Now I am interested in letting the appropriate people know about the problems.

Who is the best contact to report a problem with a Slackware network script, specifically "rc.inet1" and "rc.wireless"?

rc.inet1.conf file exhibiting problem.
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="192.168.175.99"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth1:1
IFNAME[2]="eth1:1"
IPADDR[2]="89.89.89.99"
NETMASK[2]="255.255.255.0"
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth1:2
IFNAME[3]="eth1:2"
IPADDR[3]="89.89.80.99"
NETMASK[3]="255.255.255.0"
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
GATEWAY=""

# Change this to "yes" for debugging output to stdout.  Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"
Commented lines omitted.

The "rc.wireless" script was not removing the ":1" or ":2" from the device names. That caused "cat" to report an error when the script tests some information in "/sys".

Errors reported by "rc.wireless":
Code:
cat: '/sys/class/net/eth1:1/uevent': No such file or directory
cat: '/sys/class/net/eth1:2/uevent': No such file or directory
I copied the "cut" command used in "rc.inet1" to correct the problem. The errors might have been harmless.

Excerpt from modified "rc.wireless":
Code:
is_wireless_device ()
{
    # Return 0 for a wireless interface, or 1 for a non-wireless interface.
    if LC_ALL=C $IWPATH/iwconfig `echo ${1}: | cut -f 1 -d :` 2>&1 | grep -q "IEEE 802.11" ; then
        return 0
    elif [ -d /sys/class/net/`echo ${1}: | cut -f 1 -d :`/wireless ]; then
        return 0
    elif [ "$(cat /sys/class/net/`echo ${1}: | cut -f 1 -d :`/uevent | grep DEVTYPE)" = "DEVTYPE=wlan" ]; then 
        return 0
    else # all tests failed, assume the device is not wireless (or add a better test :)
        return 1
    fi
}
The "rc.inet1" script takes down the network interfaces in the same order as it brought them up. That causes a problem because it disables the main network interface "eth1" before disabling "eth1:1" and "eth1:2".

Errors reported by "rc.inet1":
Code:
SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
It is probably harmless and also will occur when attempting to shut down an interface that is already down.

I changed the script to shut down the interfaces in the reverse order, from the last to the first.

Exceprt from modified "rc.inet1":
Code:
# Function to stop the network:
stop() {
  gateway_down
  i=$MAXNICS
  while [ $i -gt 0 ]; do
    i=$(($i-1))
    if_down ${IFNAME[$i]}
  done
  lo_down
}
The script already took into account that gateways had to be shut down first and the loop-back driver last.

One other suggestion that I would like to make is for a network parameter "AUTO[n]" that defaults to "yes". Valid settings would be "yes", "start", "stop", or "no". It would be helpful to exclude interfaces from the automatic network startup and/or shutdown done by "rc.inet1" but still allow manual startup with "rc.inet1 wlan0_start" for example. The "AUTO[n]" parameter would be tested by "start()" and "stop()" but not by "if_up()" or "if_down()". The "yes" or "" setting would automatically start and stop the interface. A setting of "start" or "stop" would only do the requested action automatically. The "no" setting would neither start nor stop the interface when starting or stopping all interfaces.

Mostly the reason for excluding an interface is to avoid the 10 second wait for a DHCP attempt. Another reason is to avoid the default route being set to that interface.
 
Old 12-13-2016, 10:15 PM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,502

Rep: Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459Reputation: 8459
Thanks. Bug report noted.
 
  


Reply



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
Multiple NICs with addresses on same network segment matsvw Linux - Networking 4 08-04-2016 11:16 AM
LXer: Tutorial: Assigning Multiple Addresses to a Network Interface LXer Syndicated Linux News 0 10-10-2008 04:30 PM
What do I need to set up a network with multiple IP addresses? kerinism1 Linux - Networking 10 10-06-2007 05:33 AM
how do i group multiple global ip addresses on a single network iterface? shinacalypse Linux - Networking 3 09-08-2003 06:07 AM
Multiple IP addresses on one network card jeucken Linux - Networking 1 10-04-2002 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:33 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