Share

lfw

Tracker: Patches

1 Problem when using 801.1Q VLAN - ID: 1621393
Last Update: Settings changed ( wand )

I recently had cause to configure 802.1Q VLAN support on a system using the
rc.firewall script, and encountered what I believe to be a bug…

When using 802.1Q VLAN support you end up with a number of virtual
interfaces that may be configured with different addresses etc. each
interface name consists of the original interface’s name a period ‘.’
and then a number (starting from 1). So, for example, configuring a virtual
interface on eth0, will result in two interfaces, “eth0” and
“eth0.1” to be present on the system.

I think that there is a bug in the code that attempts to “Obtain list of
external interfaces.” On a system configured with VLAN interfaces
$INTERFACE, which contains the name of each interface in the system on a
separate line, will for example contain:-

eth0
eth0.1

If the firewall configuration involves having eth0 as one of the internal
interfaces, i.e. $INTERNAL_INTERFACES contains “eth0”, then the
lines:-

for INTERFACE in $INTERNAL_INTERFACES; do
EXTERNAL_INTERFACES=`echo "$EXTERNAL_INTERFACES" | sed s/^$INTERFACE//`
done

which I believe are attempting to remove any interfaces present in the
$INTERNAL_INTERFACES variable (a list of interfaces to be configured as
internal) from the $EXTERNAL_INTERFACES variable will result in the
$EXTERNAL_INTERFACES variable containing “.1”. This is because the sed
command is matching all occurrences of “eth0” at the beginning of a
line and removing them.

I found that adding a ‘$’ to the end of the sed regular expression
(which asks sed to match the search string to be at the end of the line (in
addition to the ‘^’ which requests sed to match the search string from
the beginning of the line) results in the desired behaviour.

Please see attached “vlan.patch” which implements this change (along
with a typo fix in the help I noticed).


Nobody/Anonymous ( nobody ) - 2006-12-23 18:49

1

Deleted

Fixed

Nobody/Anonymous

None

None

Private


Comments ( 4 )




Date: 2007-01-03 18:13
Sender: wand


Running "vconfig set_name_type VLAN_PLUS_VID_NO_PAD" also fixes the
problem. The installation documentation has now been updated with a note
for VLAN users.


Date: 2007-01-02 11:37
Sender: nobody

Logged In: NO

Hi,

I noticed that the new patch you uploaded appears to only contain the help
typo fix (as opposed to a patch that only contains the VLAN fix?)

If you did want to test the VLAN behaviour, then you would need a kernel
with CONFIG_VLAN_802Q support (Networking\Networking options\802.1Q VLAN
support) and the “vconfig” utility.

modprobe 8021q (if it’s a module)
vconfig add eth0 1 (will create an eth0.1 interface)
ifconfig eth0.1 10.0.0.1 broadcast 10.0.0.255 netmask 255.255.255.0

Test original script and patched version….

I appreciate you probably have better things to do, my main reason for
posting a note was to highlight the problem with the new patch. In case you
are interested, thought I might as well post all the necessary information
to test it, should you be in a position to do so.

Thanks


Date: 2006-12-30 07:15
Sender: wand


Typo in "rc.firewall help" was fixed. Patch had been modified to no
longer patch the typo. I cannot confirm the usability of vlan.patch as I
do not have the environment in which to test it at this time.


Date: 2006-12-30 07:09
Sender: wand


File Added: vlan.patch


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 11 )

Field Old Value Date By
status_id Closed 2007-01-03 18:15 wand
close_date 2006-12-30 07:15 2007-01-03 18:15 wand
is_private 0 2007-01-03 18:15 wand
priority 5 2007-01-03 18:15 wand
resolution_id None 2007-01-03 18:15 wand
File Deleted 209033: 2007-01-02 19:01 wand
close_date - 2006-12-30 07:15 wand
status_id Open 2006-12-30 07:15 wand
File Added 209033: vlan.patch 2006-12-30 07:09 wand
File Deleted 208361: 2006-12-30 07:08 wand
File Added 208361: vlan.patch 2006-12-23 18:49 nobody