Author Topic: [SOLVED] Zentyl over writing network configuration  (Read 5110 times)

Barrydocks

  • Zen Warrior
  • ***
  • Posts: 145
  • Karma: +4/-0
    • View Profile
[SOLVED] Zentyl over writing network configuration
« on: October 23, 2010, 07:12:21 pm »
I have a custom networking configuration to allow bonding of 2 NICs but each time I reboot Zentyl over writes the /etc/network/interfaces file and the bonded interface fails.

Here is my /etc/network/interfaces configuration which works great:
Code: [Select]
auto lo bond0 eth2

iface lo inet loopback

#Bonded interface
iface bond0 inet static
        address 10.10.10.1
        netmask 255.255.255.0
        broadcast 10.10.10.255
        network 10.10.10.0
        up /sbin/ifenslave bond0 eth0
        up /sbin/ifenslave bond0 eth1

#WAN interface
iface eth2 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

And here is the same file after a reboot:
Code: [Select]
auto lo bond0 eth2

iface lo inet loopback
iface bond0 inet static
        address 10.10.10.1
        netmask 255.255.255.0
        broadcast 10.10.10.255

iface eth2 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        broadcast 192.168.1.255

Is there any way to stop this or is it just a matter of changing the permissions so that it is read only?
Thanks
« Last Edit: November 14, 2010, 10:54:12 pm by Barrydocks »

Sam Graf

  • Guest
Re: Zentyl over writing network configuration
« Reply #1 on: October 24, 2010, 04:37:26 am »
Maybe the following information will prove helpful to you:

http://trac.zentyal.org/wiki/Document/HowTo/ChangeEboxTemplates

Barrydocks

  • Zen Warrior
  • ***
  • Posts: 145
  • Karma: +4/-0
    • View Profile
Re: Zentyl over writing network configuration
« Reply #2 on: October 24, 2010, 09:37:31 am »
Thanks, I'll try that and see how I get on!

Barrydocks

  • Zen Warrior
  • ***
  • Posts: 145
  • Karma: +4/-0
    • View Profile
Re: Zentyl over writing network configuration
« Reply #3 on: November 12, 2010, 08:44:47 pm »
Maybe the following information will prove helpful to you:

http://trac.zentyal.org/wiki/Document/HowTo/ChangeEboxTemplates
I had a look at these template files but was not able to even decide which one I need to modifiy let alone what modifications are needed ???

Could someone please help me, I just need the following 2 lines to be included in the /etc/network/interfaces
Code: [Select]
        network 10.10.10.0
        up /sbin/ifenslave bond0 eth0
        up /sbin/ifenslave bond0 eth1
Thanks

Barrydocks

  • Zen Warrior
  • ***
  • Posts: 145
  • Karma: +4/-0
    • View Profile
Re: Zentyl over writing network configuration
« Reply #4 on: November 14, 2010, 10:53:04 pm »
After reading this post:
http://forum.zentyal.org/index.php?topic=1682.0

I have solved the problem by creating a copy of the correct config file and copying it to /etc/network/interfaces by creating a script /etc/ebox/hooks/network.postsetconf :)

Bzh7000

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: [SOLVED] Zentyl over writing network configuration
« Reply #5 on: December 01, 2010, 07:45:01 am »
Hello,
Have you more precisions please about jour solution ?
I have a similar problem but i beguining in Linux.
Tank you.

Barrydocks

  • Zen Warrior
  • ***
  • Posts: 145
  • Karma: +4/-0
    • View Profile
Re: [SOLVED] Zentyl over writing network configuration
« Reply #6 on: December 04, 2010, 11:19:14 am »
Basically zentyal calls the /etc/ebox/hooks/network.postsetconf script just before staring.  In that script you need to copy your custom network settings to the /etc/network/interfaces file.  Here's how do do it (assuming you have not installed zentyal yet):

Copy your custom interfaces file that is currently being implemented:
Code: [Select]
cp /etc/network/interfaces /etc/network/interfaces.copy
Install zentyal components as you require.

create /etc/ebox/hooks/network.postsetconf script:
Code: [Select]
nano /etc/ebox/hooks/network.postsetconf
Paste the following:
Code: [Select]
#!/bin/sh

if grep "/sbin/ifenslave" /etc/network/interfaces >/dev/null; then
        exit 0
fi
cp /etc/network/interfaces.copy /etc/network/interfaces

exit 0

make the script executable:
Code: [Select]
chmod +x /etc/ebox/hooks/network.postsetconf
reboot and make sure it all works ;D
« Last Edit: December 04, 2010, 11:25:29 am by Barrydocks »