Modify

Opened 11 years ago

Closed 9 years ago

Last modified 4 years ago

#1260 closed enhancement (fixed)

Allow specification of aliases in /etc/config/network

Reported by: andersg@… Owned by: developers
Priority: low Milestone: Barrier Breaker 14.07
Component: base system Version:
Keywords: Cc:

Description

Here are two patches that I use on my router.

Adds support to ipcalc for cidr-notation.
That is in turn used to allow cidr notation in the /etc/config/network file.
Making it possible to write:

config interface wan
  option ifname eth0
  option ipaddr 10.255.32.161/30

instead of:

config interface wan
  option ifname eth0
  option ipaddr 10.255.32.161
  option netmask 255.255.255.252

Really no biggie, but makes it a bit more nice imho.



This change depends on the first change (or at least the ipcalc change)

It allows specification of aliases on interfaces in the /etc/config/network file.

config interface dmz
  option ifname eth1
  option ipaddr 192.168.32.1/24
  option aliases "192.168.32.2/24 192.168.34.1/24 169.254.1.1/16"

which will create the eth1 interface with the 192.168.32.1 address, aswell as eth1:1, eth1:2, eth1:3 with 192.168.32.2, 192.168.34.1 and 169.254.1.1 as their addresses.

Attachments (3)

cidr+aliases.patch (2.7 KB) - added by me@… 10 years ago.
updated patch for cidr+aliases
cidr+aliases.2.patch (3.0 KB) - added by me@… 10 years ago.
updated patch for cidr+aliases (fix-left out diff index)
cidr+aliases.3.patch (3.0 KB) - added by me@… 10 years ago.
last fix, i swear.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by florian

  • Milestone set to Kamikaze

comment:2 Changed 11 years ago by jirif <jiri.fojtasek@…>

Hello

This patch fixing dnsmasq range calculation:

                netmask=compl(2**(32-int(substr(ARGV[1],slpos+1)))-1)
+               ARGV[4]=ARGV[3]
                ARGV[3]=ARGV[2]

comment:3 Changed 11 years ago by jirif <jiri.fojtasek@…>

Hello

This fix dnsmasq range calculation in ipcalc.sh:

                netmask=compl(2**(32-int(substr(ARGV[1],slpos+1)))-1)
+               ARGV[4]=ARGV[3]
                ARGV[3]=ARGV[2]

comment:4 Changed 10 years ago by khurram_ali@…

The patches above need to be corrected so that they reference ipcalc.sh and not ipcalc

Changed 10 years ago by me@…

updated patch for cidr+aliases

Changed 10 years ago by me@…

updated patch for cidr+aliases (fix-left out diff index)

Changed 10 years ago by me@…

last fix, i swear.

comment:5 Changed 9 years ago by florian

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

Fixed with [12241].

comment:6 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

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.