Author Topic: How to connect Zentyal to a WIFI network  (Read 9915 times)

ibagur

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
How to connect Zentyal to a WIFI network
« on: April 03, 2013, 02:01:58 pm »
Dear all,

I'm just testing and playing a little bit with Zentyal. I have installed on a standard HP desktop machine, which is not intended to be used as a proper server. Anyway, when I started the installation, I was prompted for the details and password of my current wifi SSID, which I provided so the installation wizard could configure some stuff (set the time and location, download some updates, etc.).

The thing is that when the system reboot, I entered in the Zentyal graphical environment and it seems it is not connected anymore to my WIFI network. I played a little bit with the network configuration through the Zentyal web interface, but I could not find where to set up the SSID and psk password. From the web interface, I have set the IP as static instead of DHCP, and added some generic DNS (the google ones), but obviously I cannot still connect to my wifi router.

I know that Zentyal is intended to be used as a gateway and service provider, but at the moment I just want to play a little bit with it to get familiar with the system. I tried to manually edit the /etc/network/interfaces file, but when I reboot, Zentyal overrides my settings. Same with the resolv.conf file.

Is there anyway to just simply connect Zentyal to my home wifi network?

Thanks

jorge_vitrubio

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to connect Zentyal to a WIFI network
« Reply #1 on: April 10, 2013, 02:25:56 pm »
hello all,

I am having similar situation, and I have read and followed all post regarding this issue
this help in where to configure the automatition:
    http://trac.zentyal.org/wiki/Documentation/Community/HowTo/SetupWireless

this one with a very generic response:
   http://forum.zentyal.org/index.php?topic=8903.0

and finally this other one wich seems almost to work exept for the password
    http://forum.zentyal.org/index.php?topic=9518.0

So, in the last example, i get the ESSID ok but what about the password?
I am not able to edti the /etc/network/interfaces and then restart because Zentyal is taking over it.

thanks in advance for the help
jorge.

ichat

  • Zen Hero
  • *****
  • Posts: 795
  • Karma: +28/-16
  • RTFM!
    • View Profile
Re: How to connect Zentyal to a WIFI network
« Reply #2 on: April 15, 2013, 02:08:41 pm »
i can not say it to many times,   files that are managed by zentyal do NOT live in  /etc 


google =  "zentyal stubs"  or  "zentyal  template" and you will find your answer.
All tips hints and advices are based on my personal experience.
As I try my best to be as accurate as possible, following my advice is always at your own risk,
I claim absolutely NO responsibility in any way!

jakob

  • Guest
Re: How to connect Zentyal to a WIFI network
« Reply #3 on: June 10, 2014, 10:30:23 pm »
hello all,

I am having similar situation, and I have read and followed all post regarding this issue
this help in where to configure the automatition:
    http://trac.zentyal.org/wiki/Documentation/Community/HowTo/SetupWireless

this one with a very generic response:
   http://forum.zentyal.org/index.php?topic=8903.0

and finally this other one wich seems almost to work exept for the password
    http://forum.zentyal.org/index.php?topic=9518.0

So, in the last example, i get the ESSID ok but what about the password?
I am not able to edti the /etc/network/interfaces and then restart because Zentyal is taking over it.

thanks in advance for the help
jorge.


Hi,

I found a solution to this:

First, install the wpa_supplicant package:
Code: [Select]
sudo apt-get install wpasupplicant
Then, write a config file for the network, that you want to connect for. For my setup, it looks like this:
Code: [Select]
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Code: [Select]
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1

network={
        ssid="YOUR_SSID"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=TKIP
        psk="YOUR_KEYPHRASE"
}

You can read how to adapt the settings to your needs here (in German language):
http://wiki.ubuntuusers.de/WLAN/wpa_supplicant
or here (English):
https://help.ubuntu.com/community/Network802.1xAuthentication

After this is done, edit your /etc/zentyal/hooks/network.postsetconf:

Code: [Select]
#!/bin/sh
export WLAN_IFACE="wlan0"
export WLAN_ESSID="YOUR_SSID"
export WLAN_CONF="    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf"
/usr/share/zentyal-network/setup-wireless
exit 0

If your script /usr/share/zentyal-network/setup-wireless looks somewhat like this, your /etc/network/interfaces should be assembled correctly every time you restart:

Code: [Select]
#!/usr/bin/perl

my $iface = $ENV{'WLAN_IFACE'};
defined($iface) or exit 0;

my $essid = $ENV{'WLAN_ESSID'};
defined($essid) or exit 0;

my $extra_conf = $ENV{'WLAN_CONF'};
my $conf = "    essid $essid\n";
if(defined($extra_conf)) {
    $conf .= ($extra_conf . "\n");
}
my $ifile = '/etc/network/interfaces';
my $newifile = '/etc/network/interfaces.new';

open(IFACES, $ifile);
open(NEW_IFACES, '>', $newifile);
my $print = 1;
for my $line (<IFACES>) {
    print NEW_IFACES $line;
    if ($line =~ m/^iface $iface/) {
        print NEW_IFACES $conf;
    }
}

close(NEW_IFACES);
close(IFACES);
rename($newifile, $ifile);

I hope this helps, it took me quite a while to figure out  ;)