Modify

Opened 10 years ago

Closed 4 years ago

Last modified 3 years ago

#2829 closed defect (worksforme)

It is not possibile to assign multiple IP Addresses to an interface using /etc/config/network

Reported by: zioproto@… Owned by: developers
Priority: normal Milestone:
Component: base system Version:
Keywords: Cc: zioproto@…, clauz@…, nino@…

Description

It is not possibile to assign multiple IP Addresses to an interface using /etc/config/network

This should be fixed because it is a base feature of a router :(

The only workaround I found to have this performed at boot time is something like this in /etc/init.d/custom-user-startup

ip addr add 192.168.6.65/28 dev wl0

That works perfect, but then is not possibile to write a webif patch to manage multiple IP Addresses for one interface.

Note that tickets #1727 and #1260 are about similar topics.

But in this ticket we don't talk about aliases, I mean 1 interface name with multiple IP addresses

Attachments (0)

Change History (8)

comment:1 follow-up: Changed 10 years ago by florian

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #1260

comment:2 in reply to: ↑ 1 Changed 10 years ago by zioproto@…

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Replying to florian:

Duplicate of #1260

THIS IS NOT A DUPLICATE OF TICKET #1260 - PLEASE READ CAREFULLY

I'm sorry if I did not exaplain my self in the description of the ticket, I'll try to make this more clear.

Ticket #1260 deals with ALIASES that means assigning more IP addresses to one interface, creating interfaces like eth1:0 eth1:1 eth1:2

That is a OLD WAY of giving more than 1 IP to a interface.

The NEW WAY in Linux is keeping ONE INTERFACE (e.g. eth1) and assigning to it more IP addresses using the iproute2 suite.

iproute2 is already ported in OpenWRT, see:

http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/packages/ip_2.6.20-070313-1_mipsel.ipk

What we ask in this ticket is support this feature (1 Interface name with many IP addresses) in /etc/network/config

comment:3 Changed 8 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

I can't really understand the problem, adding additional IPs with "ip" is the same as ifconfig eth0:foo ... just with the label omitted. The generated eth0:X is *no* extra interface, it can't be addressed with route or iptables and behaves just like additional addresses added with "ip".

Since I see no point in adding another kind of aliases just with label omitted and the already implemented ones work as expected I close this ticket as "worksforme".

comment:4 Changed 5 years ago by banglang.huang@…

how about the result of this problem? Had it been solved ?
I don't know if the openwrt can set multipile ipaddress with 1 interface?

comment:5 Changed 5 years ago by anonymous

And what about IPv6? There is no interface alias available!

comment:6 Changed 4 years ago by jb-debbugs@…

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Reopening this issue, it was closed by someone who didn't understand the description, and was not automatically reopened when other users commented that the close was erroneous, as it referred to a workaround that is ipv4 only and not inline with current Linux kernel principles.

So here is the rephrased, clarified description:

Please enhance /etc/config/network parsing to allow multiple "ipadd" and multiple "ip6addr" option values (or an equivalent syntax) for a single "config interface" section.

This might be implemented by having uci map this to appropriate invocations of the "ip" command from busybox, rather than the old ifconfig alias method.

comment:7 Changed 4 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

All that stuff is already implemented.

You can specify it like this:

config interface foo
  option ifname eth1
  list ipaddr 10.8.0.1/24
  list ipaddr 10.9.0.1/24
  list ip6addr fdca:abcd::1/64
  list ip6addr fdca:cdef::1/64

Alternatively you can specify multiple interfaces sharing the same device:

config interface foo
  option ifname eth1
  option ipaddr 10.8.0.1
  option netmask 255.255.255.0
  option ip6addr fdca:abcd::1/64

config interface foo2
  option ifname eth1
  option ipaddr 10.9.0.1
  option netmask 255.255.255.0
  option ip6addr fdca:cdef::1/64

The stuff requested here *is* implemented in trunk and it *works* when trying it here. I don't see the point of the comment above.

comment:8 Changed 4 years ago by jb-sitecomments@…

Ok, leaving it closed then, that "list ip6addr" syntax was what this bug was asking for.

But please note:

  • The "list ip6addr" feature was not in Backfire (10.03.1), and I cannot tell from the Attitude Adjustment (12.09) announcement and its linked "core changelog" if it is in that release. So until then, I will have to use workarounds.
  • The documentation at http://wiki.openwrt.org/doc/uci/network has not yet been updated to reflect that you have now implemented this feature, once that is done, you should change the resolution from "worksforme" to actually "fixed".

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.