Bug #3091

Alias ifcfg-ethX:Y files invalid syntax

Added by Filippo Carletti over 6 years ago. Updated about 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-base
Target version:v6.6
Security class: Resolution:
Affected version:v6.6-final NEEDINFO:No

Description

At boot, I saw the following message:

./ifcfg-eth1:0: line 2: websrv: command not found

It's due to this line:
# cat /etc/sysconfig/network-scripts/ifcfg-eth1:0
DEVICE=eth1:0
*FWOBJECTNAT=host;websrv*
BOOTPROTO=none
IPADDR=192.168.5.223
NETMASK=255.255.255.0

It comes from a NAT 1:1 entry pointing to an host object named websrv.

To reproduce:
1. add an alias ip
2. add a nat 1:1 to the alias
3. recreate ifcfg-eth* files with signal-event interface update
4. service network restart

Associated revisions

Revision 4d27776f
Added by Davide Principi over 6 years ago

interface-config-write: Skip role and any prop starting with "Fw". Refs #3091

History

#1 Updated by Edoardo Spadoni over 6 years ago

  • Category set to nethserver-firewall-base
  • Status changed from NEW to TRIAGED
  • Target version set to v6.6
  • % Done changed from 0 to 20

The value of property FWOBJECTNAT could be only the name of host: FWOBJECTNAT=websrv without host type. The host type can be found in Host database by getting type of key, then the complete firewall object name, useful to get its ip address, can be composed during template-expanding phase. Like below:

# compose firewall obj
$fw_key_obj = $hdb->get($fw_obj);
$fw_key_type = $fw_key_obj->prop('type');
$fw_obj_total = $fw_key_type.";".$fw_obj;

# get hostname
$internal_ip = $fw->getAddress($fw_obj_total);

Tha same approach can be used for /etc/shorewall/rtrules (for MULTI WAN setup)

#2 Updated by Edoardo Spadoni over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Edoardo Spadoni
  • % Done changed from 20 to 30

#3 Updated by Edoardo Spadoni over 6 years ago

  • Status changed from ON_DEV to TRIAGED
  • Assignee deleted (Edoardo Spadoni)
  • % Done changed from 30 to 20

#4 Updated by Giacomo Sanchietti over 6 years ago

Edoardo Spadoni wrote:

The value of property FWOBJECTNAT could be only the name of host: FWOBJECTNAT=websrv without host type. The host type can be found in Host database by getting type of key, then the complete firewall object name, useful to get its ip address, can be composed during template-expanding phase. Like below:

The format object_type;object_name is a system wide standard and should not be changed.

We can simply change the interface-config-write script to ignore all properties like fwobjectnat.

#5 Updated by Davide Principi over 6 years ago

Giacomo Sanchietti wrote:

We can simply change the interface-config-write script to ignore all properties like fwobjectnat.

...that was the original idea: ignore any prop prefixed with FW*

#6 Updated by Giacomo Sanchietti over 6 years ago

  • Category changed from nethserver-firewall-base to nethserver-base

#7 Updated by Davide Principi over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30
  • Affected version changed from v6.6 to v6.6-final

#8 Updated by Davide Principi over 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

MODIFIED

Any prop starting with Fw (case-sensitive) is ignored (along with role).

#9 Updated by Davide Principi over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-base-2.7.0-1.1.g4d27776.ns6.noarch.rpm

#10 Updated by Giacomo Sanchietti about 6 years ago

  • Assignee set to Giacomo Sanchietti

#11 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

The bug is reproducible only after the interface-update event is fired.
Also the fix is applied only after the interface-update event is fired.

#12 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-base-2.7.1-1.ns6.noarch.rpm

Also available in: Atom PDF