个人工具

“UbuntuHelp:RoamingProfilesWithNetworkManager”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/RoamingProfilesWithNetworkManager}} {{Languages|UbuntuHelp:RoamingProfilesWithNetworkManager}} == Roaming Profiles with NetworkManager == Skill...)
 
 
(未显示同一用户的6个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/RoamingProfilesWithNetworkManager}}
 
{{From|https://help.ubuntu.com/community/RoamingProfilesWithNetworkManager}}
 
{{Languages|UbuntuHelp:RoamingProfilesWithNetworkManager}}
 
{{Languages|UbuntuHelp:RoamingProfilesWithNetworkManager}}
 
 
 
== Roaming Profiles with NetworkManager ==
 
== Roaming Profiles with NetworkManager ==
 
 
Skill: ''Intermidiate''
 
Skill: ''Intermidiate''
 
Complexity: ''Moderate''
 
Complexity: ''Moderate''
 
Est``Time``To``Complete: ''1.5 hours''  
 
Est``Time``To``Complete: ''1.5 hours''  
 
+
Related``Mod: ''[[UbuntuHelp:DynamicFirewall|DynamicFirewall]]''
Related``Mod: ''DynamicFirewall''
+
Optional``Mod: ''[[UbuntuHelp:AnonymizingNetworkMACAddresses|AnonymizingNetworkMACAddresses]]''
Optional``Mod: ''Self:AnonymizingNetworkMACAddresses''
+
This guide is aimed at laptop/portable systems with a single wifi interface and a single wired interface. However, the methods are applicable to varied other system setups. I also recommend installing the [[UbuntuHelp:DynamicFirewall|DynamicFirewall]] to help secure and offer a layer of protection while you are roaming about. Optionally you may consider [[UbuntuHelp:AnonymizingNetworkMACAddresses|AnonymizingNetworkMACAddresses]] to afford some privacy.
 
+
This guide is aimed at laptop/portable systems with a single wifi interface and a single wired interface. However, the methods are applicable to varied other system setups. I also recommend installing the DynamicFirewall to help secure and offer a layer of protection while you are roaming about. Optionally you may consider Self:AnonymizingNetworkMACAddresses to afford some privacy.
+
 
+
 
Sometimes there are specific local settings depending on the network you've associated to. For example, when on the ''work'' network you have default printers, unique firewall rules or other applications with location specific settings that are substantially different for ''home'' network settings. This guide will illustrate a way to provide roaming profiles via Network``Manager.
 
Sometimes there are specific local settings depending on the network you've associated to. For example, when on the ''work'' network you have default printers, unique firewall rules or other applications with location specific settings that are substantially different for ''home'' network settings. This guide will illustrate a way to provide roaming profiles via Network``Manager.
 
 
Network``Manager is fantastic, if you let it ''completely'' manage the network. Laptop-net is fantastic at managing profiles. However things just don't work well using laptop-net and Network``Manager together.
 
Network``Manager is fantastic, if you let it ''completely'' manage the network. Laptop-net is fantastic at managing profiles. However things just don't work well using laptop-net and Network``Manager together.
 
 
So, rather than force laptop-net to accomodate Network``Manager's penchant for total control, I've devised some procedural additions that work ''within'' Network``Manager's methodology.
 
So, rather than force laptop-net to accomodate Network``Manager's penchant for total control, I've devised some procedural additions that work ''within'' Network``Manager's methodology.
 
 
With the following configuration examples you can change most system settings, except static ip address management. I attempted to utilize the Network``Manager interface status system to force the static ip assignment but failed at every attempt. Accomodating for static addresses will hopefully be resolved in 0.7 of Network``Manager. There is a kludge to force static ip assignments after Network``Manager completes.
 
With the following configuration examples you can change most system settings, except static ip address management. I attempted to utilize the Network``Manager interface status system to force the static ip assignment but failed at every attempt. Accomodating for static addresses will hopefully be resolved in 0.7 of Network``Manager. There is a kludge to force static ip assignments after Network``Manager completes.
 
 
Regardless, the following examples illustrate ways to change profiles using Network``Manager alone. The examples emulate the behaviour of laptop-net. While not as complete as what laptop-net it at least cooperates with Network``Manager.
 
Regardless, the following examples illustrate ways to change profiles using Network``Manager alone. The examples emulate the behaviour of laptop-net. While not as complete as what laptop-net it at least cooperates with Network``Manager.
 
 
Attachments are provided containing the initial file heiarchy. Download the tarball archives and review prior to installation.
 
Attachments are provided containing the initial file heiarchy. Download the tarball archives and review prior to installation.
 
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
'''You will have to edit/add/remove the script files to make them fit your environment.'''
 
 
Commands in the guide assume you have sudo'ed root. i.e., ''sudo -i'' after each login.
 
Commands in the guide assume you have sudo'ed root. i.e., ''sudo -i'' after each login.
 
 
== Load TarBall Archives ==
 
== Load TarBall Archives ==
 
+
Save the tarball: [[UbuntuHelp:attachment:nmprofiles.tar.gz|attachment:nmprofiles.tar.gz]]
Save the tarball: https://help.ubuntu.com/community/RoamingProfilesWithNetworkManager?action=AttachFile&do=get&target=nmprofiles.tar.gz
+
 
+
 
<pre><nowiki>
 
<pre><nowiki>
 
cd /
 
cd /
 
tar xvfzp nmprofiles.tar.gz
 
tar xvfzp nmprofiles.tar.gz
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== File Descriptions and Behavior ==
 
== File Descriptions and Behavior ==
 
 
This set of files is for the static IP address assignment kludge described later on. Includes the firewall reload.
 
This set of files is for the static IP address assignment kludge described later on. Includes the firewall reload.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
etc/network/
 
etc/network/
第54行: 第33行:
 
etc/network/force_home-wired
 
etc/network/force_home-wired
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This is the location and example file set for your roaming network profile scripts that move files, restart services and reload the firewall.
 
This is the location and example file set for your roaming network profile scripts that move files, restart services and reload the firewall.
 
 
The `nm-dispatcher` and the `dispatcher.d` scripts work together. Files in `dispatcher.d` are called in alpha order. The `99*` scripts have an include for code from `nm-dispatcher`. The `99*` scripts are only executed ''if the interface name and ip addresses'' of the passed interface ''match''.
 
The `nm-dispatcher` and the `dispatcher.d` scripts work together. Files in `dispatcher.d` are called in alpha order. The `99*` scripts have an include for code from `nm-dispatcher`. The `99*` scripts are only executed ''if the interface name and ip addresses'' of the passed interface ''match''.
 
 
=== NetworkManager Device Order and if-*.d Files ===
 
=== NetworkManager Device Order and if-*.d Files ===
 
 
The files in `/etc/nm-profiles/<PROFILENAME>/if*.d` are called from `/etc/NetworkManager/dispatcher.d/99*` scripts. The device state determines the group of scripts to call.  
 
The files in `/etc/nm-profiles/<PROFILENAME>/if*.d` are called from `/etc/NetworkManager/dispatcher.d/99*` scripts. The device state determines the group of scripts to call.  
 
 
When a device is activated the call order is:
 
When a device is activated the call order is:
 
<pre><nowiki>
 
<pre><nowiki>
第68行: 第42行:
 
up
 
up
 
</nowiki></pre>
 
</nowiki></pre>
 
 
When a device is deactivated the call order is:
 
When a device is deactivated the call order is:
 
<pre><nowiki>
 
<pre><nowiki>
 
down
 
down
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* It has been my experience that '''post-down''' is never reached/called when a device is deactivated.
 
* It has been my experience that '''post-down''' is never reached/called when a device is deactivated.
 
+
The files are called in ''alpha'' order. The script examples copy location specific files, reloads the firewall (refer to [[UbuntuHelp:DynamicFirewall|DynamicFirewall]]), and restarts services who's configuration files were altered.
The files are called in ''alpha'' order. The script examples copy location specific files, reloads the firewall (refer to DynamicFirewall), and restarts services who's configuration files were altered.
+
 
+
 
=== Dispatcher.d Files ===
 
=== Dispatcher.d Files ===
 
 
You'll need to edit the `99*` files to reflect the ''network ip numbers'' and ''interface names'' of your particular environments. Also, create any custom `dispatcher.d` files for other profiles you need. The profile script files in `dispatcher.d` have an evident section which requires set values for determining which network you've connected.
 
You'll need to edit the `99*` files to reflect the ''network ip numbers'' and ''interface names'' of your particular environments. Also, create any custom `dispatcher.d` files for other profiles you need. The profile script files in `dispatcher.d` have an evident section which requires set values for determining which network you've connected.
 
 
This setting names the profile. Change to suit your needs. Just remember to update/add to `/etc/nm-profiles/NMPROFNAME`.
 
This setting names the profile. Change to suit your needs. Just remember to update/add to `/etc/nm-profiles/NMPROFNAME`.
 
<pre><nowiki>
 
<pre><nowiki>
 
NMPROFNAME="home-wifi"
 
NMPROFNAME="home-wifi"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This sets the profiles phase scripts and location specific files directory.
 
This sets the profiles phase scripts and location specific files directory.
 
<pre><nowiki>
 
<pre><nowiki>
 
NMPROFDIR="/etc/nm-profiles"
 
NMPROFDIR="/etc/nm-profiles"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This is a ''PERL regex'' to match the activated devices ip address to. It can as complex as you need. But, in most instances a partial subnet of the location specific network address is all that is needed to differentiate networks.
 
This is a ''PERL regex'' to match the activated devices ip address to. It can as complex as you need. But, in most instances a partial subnet of the location specific network address is all that is needed to differentiate networks.
 
<pre><nowiki>
 
<pre><nowiki>
 
IPMATCH="10.10.10"
 
IPMATCH="10.10.10"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This is also a ''PERL regex'' to match the activated devices name. It can as complex as you need. But, in most instances a single interface name will suffice to differentiate profiles.
 
This is also a ''PERL regex'' to match the activated devices name. It can as complex as you need. But, in most instances a single interface name will suffice to differentiate profiles.
 
<pre><nowiki>
 
<pre><nowiki>
 
IFMATCH="eth0"
 
IFMATCH="eth0"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
''* Complex example where you want ANY of these address masks and matching interface names to activate the named profile.''
 
''* Complex example where you want ANY of these address masks and matching interface names to activate the named profile.''
 
<pre><nowiki>
 
<pre><nowiki>
 
IPMATCH="10.10.11|192.168.10|172.16.10"
 
IPMATCH="10.10.11|192.168.10|172.16.10"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
''* Complex example where you want ANY of the interface names and matching ip address masks to activate the named profile.''
 
''* Complex example where you want ANY of the interface names and matching ip address masks to activate the named profile.''
 
<pre><nowiki>
 
<pre><nowiki>
 
IFMATCH="ath0|eth0|eth1"
 
IFMATCH="ath0|eth0|eth1"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Active Phase Range ===
 
=== Active Phase Range ===
 
 
As the scripts are currently setup the only phases to ever be reached for profile scripting are ''up''.
 
As the scripts are currently setup the only phases to ever be reached for profile scripting are ''up''.
 
 
=== Dispatcher Worker and 99* Actions ===
 
=== Dispatcher Worker and 99* Actions ===
 
 
Network``Manager passes the ''acting interface name'' and ''phase'' to the `dispatcher.d` scripts. Your `99*` profile scripts armed with the interface name and phase then make a determination about where you are.
 
Network``Manager passes the ''acting interface name'' and ''phase'' to the `dispatcher.d` scripts. Your `99*` profile scripts armed with the interface name and phase then make a determination about where you are.
 
 
To simplify your scripting a worker shell script `nm-dispatchworker` is installed and called by the dispatcher scripts. The worker script gathers the current interface ip address assignment and matches the current interface name to determine when a location profile is matched.
 
To simplify your scripting a worker shell script `nm-dispatchworker` is installed and called by the dispatcher scripts. The worker script gathers the current interface ip address assignment and matches the current interface name to determine when a location profile is matched.
 
 
Only when the IP ADDRESS and INTERFACE NAME matches the acting interface will the named profile phase scripts be called.
 
Only when the IP ADDRESS and INTERFACE NAME matches the acting interface will the named profile phase scripts be called.
 
 
''Example'': Network``Manager is activating eth0. Network``Manager(NM) passes phase ''pre-up'' and interface name ''eth0'' to every script in `/etc/NetworkManager/dispatcher.d`. `99home-wifi` is called which attempts to get the current ip address assignment for ''eth0''. Since there is no ip address assignment for ''eth0'' yet, the check for a match against the defined `IPMATCH` will fail. Therefore the `/etc/nm-profiles/home-wifi/if-pre-up.d` scripts will not be called.  
 
''Example'': Network``Manager is activating eth0. Network``Manager(NM) passes phase ''pre-up'' and interface name ''eth0'' to every script in `/etc/NetworkManager/dispatcher.d`. `99home-wifi` is called which attempts to get the current ip address assignment for ''eth0''. Since there is no ip address assignment for ''eth0'' yet, the check for a match against the defined `IPMATCH` will fail. Therefore the `/etc/nm-profiles/home-wifi/if-pre-up.d` scripts will not be called.  
 
 
Network``Manager(NM) then passes phase ''up'' and interface name ''eth0'' to the dispatcher.d scripts. `99home-wifi` is called which then gets the current ip address assignment for ''eth0''. Now that there is an address assigned to ''eth0'' it is checked against `IPMATCH`. If the ip address mask ''and'' interface name match then the `/etc/nm-profiles/home-wifi/if-up.d` scripts are called in alpha order.  
 
Network``Manager(NM) then passes phase ''up'' and interface name ''eth0'' to the dispatcher.d scripts. `99home-wifi` is called which then gets the current ip address assignment for ''eth0''. Now that there is an address assigned to ''eth0'' it is checked against `IPMATCH`. If the ip address mask ''and'' interface name match then the `/etc/nm-profiles/home-wifi/if-up.d` scripts are called in alpha order.  
 
 
Network``Manager does not pass on ''post-up''.
 
Network``Manager does not pass on ''post-up''.
 
 
This example applies to the deactivation of an interface where matched interface name and ip addresses will call ''down, post-down'' profile scripts.
 
This example applies to the deactivation of an interface where matched interface name and ip addresses will call ''down, post-down'' profile scripts.
 
 
In general, unless you severly modify the dispatcher.d scripts, ''post-up, pre-down'' profile scripts will not be activated since either the ip address hasn't yet been assigned or was released.
 
In general, unless you severly modify the dispatcher.d scripts, ''post-up, pre-down'' profile scripts will not be activated since either the ip address hasn't yet been assigned or was released.
 
 
== Static IP Assignment Kludge ==
 
== Static IP Assignment Kludge ==
 
 
A `home-wired` and `work-wired` script are included to force a static ip assignment. I have not been able to force it using the Network``Manager methods. Once the network assignments are completed run the scripts to force the static ip assignment. Adjust to your needs.
 
A `home-wired` and `work-wired` script are included to force a static ip assignment. I have not been able to force it using the Network``Manager methods. Once the network assignments are completed run the scripts to force the static ip assignment. Adjust to your needs.
 
 
=== Create GNOME Custom Application Launch ===
 
=== Create GNOME Custom Application Launch ===
 
 
Right-click on the system bar and select `Add to panel...`.
 
Right-click on the system bar and select `Add to panel...`.
 
 
Select `Custom Application Launcher`.
 
Select `Custom Application Launcher`.
 
 
When the dialoge window appears select `Type: Application in Terminal`
 
When the dialoge window appears select `Type: Application in Terminal`
 
 
Provide a meaningfull `Name:` label.
 
Provide a meaningfull `Name:` label.
 
 
Enter the `Command: sudo -i /etc/network/<forceScriptName>` where the script is one of:
 
Enter the `Command: sudo -i /etc/network/<forceScriptName>` where the script is one of:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
force_work-wired
 
force_work-wired
 
force_home-wired
 
force_home-wired
 
</nowiki></pre>
 
</nowiki></pre>
 
 
These scripts reconfigure the interfaces for a static ip address assignment using `ifup`. Once re-assignment is complete the firewall script is run to reload with the static ip address.
 
These scripts reconfigure the interfaces for a static ip address assignment using `ifup`. Once re-assignment is complete the firewall script is run to reload with the static ip address.
 
 
You will need to edit these files to reference your firewall script file.
 
You will need to edit these files to reference your firewall script file.
 
 
''* I didn't include forced static for wirless but you could certainly setup up such scripts.''
 
''* I didn't include forced static for wirless but you could certainly setup up such scripts.''
 
 
== Offline Profile ==
 
== Offline Profile ==
 
 
There is an ''offline'' profile which will be called with the device is in action but there is no associated ip address assignment. Taylor to your requirements.
 
There is an ''offline'' profile which will be called with the device is in action but there is no associated ip address assignment. Taylor to your requirements.
 
 
== Creative Commons License ==
 
== Creative Commons License ==
 
 
Author: James B. Crocker
 
Author: James B. Crocker
 
  
 
 
[http://i.creativecommons.org/l/by-sa/3.0/88x31.png]
 
[http://i.creativecommons.org/l/by-sa/3.0/88x31.png]
 
 
This work is licensed under a [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-Share Alike 3.0 License].
 
This work is licensed under a [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-Share Alike 3.0 License].
 
 
----
 
----
[[category:CategoryDocumentation]] [[category:CategorySoftware]]
+
[[category:CategorySoftware]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年5月12日 (二) 18:40的最新版本

Roaming Profiles with NetworkManager

Skill: Intermidiate Complexity: Moderate Est``Time``To``Complete: 1.5 hours Related``Mod: DynamicFirewall Optional``Mod: AnonymizingNetworkMACAddresses This guide is aimed at laptop/portable systems with a single wifi interface and a single wired interface. However, the methods are applicable to varied other system setups. I also recommend installing the DynamicFirewall to help secure and offer a layer of protection while you are roaming about. Optionally you may consider AnonymizingNetworkMACAddresses to afford some privacy. Sometimes there are specific local settings depending on the network you've associated to. For example, when on the work network you have default printers, unique firewall rules or other applications with location specific settings that are substantially different for home network settings. This guide will illustrate a way to provide roaming profiles via Network``Manager. Network``Manager is fantastic, if you let it completely manage the network. Laptop-net is fantastic at managing profiles. However things just don't work well using laptop-net and Network``Manager together. So, rather than force laptop-net to accomodate Network``Manager's penchant for total control, I've devised some procedural additions that work within Network``Manager's methodology. With the following configuration examples you can change most system settings, except static ip address management. I attempted to utilize the Network``Manager interface status system to force the static ip assignment but failed at every attempt. Accomodating for static addresses will hopefully be resolved in 0.7 of Network``Manager. There is a kludge to force static ip assignments after Network``Manager completes. Regardless, the following examples illustrate ways to change profiles using Network``Manager alone. The examples emulate the behaviour of laptop-net. While not as complete as what laptop-net it at least cooperates with Network``Manager. Attachments are provided containing the initial file heiarchy. Download the tarball archives and review prior to installation. You will have to edit/add/remove the script files to make them fit your environment. You will have to edit/add/remove the script files to make them fit your environment. You will have to edit/add/remove the script files to make them fit your environment. Commands in the guide assume you have sudo'ed root. i.e., sudo -i after each login.

Load TarBall Archives

Save the tarball: attachment:nmprofiles.tar.gz

cd /
tar xvfzp nmprofiles.tar.gz

File Descriptions and Behavior

This set of files is for the static IP address assignment kludge described later on. Includes the firewall reload.

etc/network/
etc/network/interfaces_home-wired
etc/network/force_work-wired
etc/network/interfaces_work-wired
etc/network/force_home-wired

This is the location and example file set for your roaming network profile scripts that move files, restart services and reload the firewall. The `nm-dispatcher` and the `dispatcher.d` scripts work together. Files in `dispatcher.d` are called in alpha order. The `99*` scripts have an include for code from `nm-dispatcher`. The `99*` scripts are only executed if the interface name and ip addresses of the passed interface match.

NetworkManager Device Order and if-*.d Files

The files in `/etc/nm-profiles/<PROFILENAME>/if*.d` are called from `/etc/NetworkManager/dispatcher.d/99*` scripts. The device state determines the group of scripts to call. When a device is activated the call order is:

pre-up
up

When a device is deactivated the call order is:

down
  • It has been my experience that post-down is never reached/called when a device is deactivated.

The files are called in alpha order. The script examples copy location specific files, reloads the firewall (refer to DynamicFirewall), and restarts services who's configuration files were altered.

Dispatcher.d Files

You'll need to edit the `99*` files to reflect the network ip numbers and interface names of your particular environments. Also, create any custom `dispatcher.d` files for other profiles you need. The profile script files in `dispatcher.d` have an evident section which requires set values for determining which network you've connected. This setting names the profile. Change to suit your needs. Just remember to update/add to `/etc/nm-profiles/NMPROFNAME`.

NMPROFNAME="home-wifi"

This sets the profiles phase scripts and location specific files directory.

NMPROFDIR="/etc/nm-profiles"

This is a PERL regex to match the activated devices ip address to. It can as complex as you need. But, in most instances a partial subnet of the location specific network address is all that is needed to differentiate networks.

IPMATCH="10.10.10"

This is also a PERL regex to match the activated devices name. It can as complex as you need. But, in most instances a single interface name will suffice to differentiate profiles.

IFMATCH="eth0"

* Complex example where you want ANY of these address masks and matching interface names to activate the named profile.

IPMATCH="10.10.11|192.168.10|172.16.10"

* Complex example where you want ANY of the interface names and matching ip address masks to activate the named profile.

IFMATCH="ath0|eth0|eth1"

Active Phase Range

As the scripts are currently setup the only phases to ever be reached for profile scripting are up.

Dispatcher Worker and 99* Actions

Network``Manager passes the acting interface name and phase to the `dispatcher.d` scripts. Your `99*` profile scripts armed with the interface name and phase then make a determination about where you are. To simplify your scripting a worker shell script `nm-dispatchworker` is installed and called by the dispatcher scripts. The worker script gathers the current interface ip address assignment and matches the current interface name to determine when a location profile is matched. Only when the IP ADDRESS and INTERFACE NAME matches the acting interface will the named profile phase scripts be called. Example: Network``Manager is activating eth0. Network``Manager(NM) passes phase pre-up and interface name eth0 to every script in `/etc/NetworkManager/dispatcher.d`. `99home-wifi` is called which attempts to get the current ip address assignment for eth0. Since there is no ip address assignment for eth0 yet, the check for a match against the defined `IPMATCH` will fail. Therefore the `/etc/nm-profiles/home-wifi/if-pre-up.d` scripts will not be called. Network``Manager(NM) then passes phase up and interface name eth0 to the dispatcher.d scripts. `99home-wifi` is called which then gets the current ip address assignment for eth0. Now that there is an address assigned to eth0 it is checked against `IPMATCH`. If the ip address mask and interface name match then the `/etc/nm-profiles/home-wifi/if-up.d` scripts are called in alpha order. Network``Manager does not pass on post-up. This example applies to the deactivation of an interface where matched interface name and ip addresses will call down, post-down profile scripts. In general, unless you severly modify the dispatcher.d scripts, post-up, pre-down profile scripts will not be activated since either the ip address hasn't yet been assigned or was released.

Static IP Assignment Kludge

A `home-wired` and `work-wired` script are included to force a static ip assignment. I have not been able to force it using the Network``Manager methods. Once the network assignments are completed run the scripts to force the static ip assignment. Adjust to your needs.

Create GNOME Custom Application Launch

Right-click on the system bar and select `Add to panel...`. Select `Custom Application Launcher`. When the dialoge window appears select `Type: Application in Terminal` Provide a meaningfull `Name:` label. Enter the `Command: sudo -i /etc/network/<forceScriptName>` where the script is one of:

force_work-wired
force_home-wired

These scripts reconfigure the interfaces for a static ip address assignment using `ifup`. Once re-assignment is complete the firewall script is run to reload with the static ip address. You will need to edit these files to reference your firewall script file. * I didn't include forced static for wirless but you could certainly setup up such scripts.

Offline Profile

There is an offline profile which will be called with the device is in action but there is no associated ip address assignment. Taylor to your requirements.

Creative Commons License

Author: James B. Crocker EMail: [email protected] [1] This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.