Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91564 - [RFE] support for range of IP addresses in network init scripts
Summary: [RFE] support for range of IP addresses in network init scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 482184
  Show dependency tree
 
Reported: 2005-05-05 05:43 UTC by Jakub Moc (RETIRED)
Modified: 2013-08-24 00:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Moc (RETIRED) gentoo-dev 2005-05-05 05:43:40 UTC
Now I have to specify every single IP address I want to assign to a network interface. If you need to have tens of them on a single interface it
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-05-05 05:43:40 UTC
Now I have to specify every single IP address I want to assign to a network interface. If you need to have tens of them on a single interface it´s a bit pesky task. I wonder if it would be possible to specify something like (example only)

config_eth0=(
        "192.168.1.2/27:192.168.1.30/27 brd 192.168.1.31"
)

and assign all of them on a single line? Hope this is not a dupe of some bug. :p

Reproducible: Always
Steps to Reproduce:
Comment 2 SpanKY gentoo-dev 2005-05-05 07:16:27 UTC
does this work ?
config_eth0=(
        "192.168.1.{2..30}/27 brd 192.168.1.31"
)

if not, what about
eval config_eth0=(
        "192.168.1.{2..30}/27 brd 192.168.1.31"
)
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-05-05 09:39:53 UTC
OK, I tried

config_eth0=(
    "192.168.1.1/24 brd 192.168.1.255"
    "192.168.1.{10..20}/24 brd 192.168.1.255"
)


This does not work:

Error: either "local" is duplicate, or "192.168.1.11/24" is a garbage.                    

eval config_eth0=(
    "192.168.1.1/24 brd 192.168.1.255"
    "192.168.1.{10..20}/24 brd 192.168.1.255"
)

The second one is better, but not quite there:

*    Bringing up eth0
 *       192.168.1.1/24                                                                                                                [ ok ]
 *       brd
 *       No loaded modules provide "brd" (brd_start)
 *       192.168.1.255                                                                                                                 [ ok ]
 *       192.168.1.10/24                                                                                                               [ ok ]
 *       192.168.1.11/24                                                                                                               [ ok ]
 *       192.168.1.12/24                                                                                                               [ ok ]
 *       192.168.1.13/24                                                                                                               [ ok ]
 *       192.168.1.14/24                                                                                                               [ ok ]
 *       192.168.1.15/24                                                                                                               [ ok ]
 *       192.168.1.16/24                                                                                                               [ ok ]
 *       192.168.1.17/24                                                                                                               [ ok ]
 *       192.168.1.18/24                                                                                                               [ ok ]
 *       192.168.1.19/24                                                                                                               [ ok ]
 *       192.168.1.20/24                                                                                                               [ ok ]
 *       brd
 *       No loaded modules provide "brd" (brd_start)
 *       192.168.1.255                                                                                                                 [ ok ]

 # ip addr show
 eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:0c:6e:bd:65:3e brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 scope global eth0
    inet 192.168.1.255/32 scope global eth0
    inet 192.168.1.10/24 scope global secondary eth0
    inet 192.168.1.11/24 scope global secondary eth0
    inet 192.168.1.12/24 scope global secondary eth0
    inet 192.168.1.13/24 scope global secondary eth0
    inet 192.168.1.14/24 scope global secondary eth0
    inet 192.168.1.15/24 scope global secondary eth0
    inet 192.168.1.16/24 scope global secondary eth0
    inet 192.168.1.17/24 scope global secondary eth0
    inet 192.168.1.18/24 scope global secondary eth0
    inet 192.168.1.19/24 scope global secondary eth0
    inet 192.168.1.20/24 scope global secondary eth0
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-05-25 03:08:46 UTC
OK, I have this working in CVS

    config_eth0=( "192.168.{1..3}.{1..3}/24 brd +" )

expands into

    config_eth0=(
       "192.168.1.1/24 brd +"
       "192.168.1.2/24 brd +"
       "192.168.1.3/24 brd +"
       "192.168.2.1/24 brd +"
       "192.168.2.2/24 brd +"
       "192.168.2.3/24 brd +"
       "192.168.3.1/24 brd +"
       "192.168.3.2/24 brd +"
       "192.168.3.3/24 brd +"
    )



Will be in baselayout-1.12.0-alpha3
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-05-25 18:05:06 UTC
OK, thanks!
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-07-19 14:01:42 UTC
Fixed in baselayout-1.12.0_pre1-r1