PDA

View Full Version : Configuring the external interface in an appliance


Jsmart
12-06-2007, 10:46 PM
This example and attached scritps assume a primary and secondary IP on the external interface. The iptables is the standard config as in the GSC app.

The external interface is ALWAYS set as eth0 inside the appliance.

You will need to modify the iptables config to allow any ports needed for your new appliance.

Example:

Branch the class you would like to modify

Using the class editor:

Enable the external interface
Add properties: hostname, primary_ip, secondary_ip, netmask, gateway, dn1, dns2, dns3

Mount the volume and add the attached files (due to forum rules i had to add .txt to the attachments please remove it):

/appliance/appliance_netsetup.sh
/etc/init.d/appliance_netsetup
/etc/sysconfig/iptables

Make sure the scripts are executable:
chmod +x /appliance/appliance_netsetup.sh /etc/init.d/appliance_netsetup

Unmount the volume

Boot the appliance and login in through the gui

Execute
chkconfig --add appliance_netsetup
chkconfig iptables on

Restart the application and it should take your eth0 config.

--Jessie

GDR!
02-23-2009, 07:23 AM
Some errata to make it easier for others:
- it should read "chkconfig iptables on" - without the minuses
- you need to make appliance_netsetup scripts executable

csgno1
03-03-2009, 10:11 AM
Do you know what the paths would be for ubuntu?

csgno1
03-03-2009, 10:18 AM
I guess I should also ask if this information for configuring an external interface is still the current method.

PeterNic
03-03-2009, 08:17 PM
csgno1,


I guess I should also ask if this information for configuring an external interface is still the current method.

Astute question - it should be simpler now.

It always was very simple: you define a set of properties that are typically needed to configure the external interface -- typically, at least the IP address, netmask, gateway and dns server(s). Our standard VDS template has two IP addresses and the hostname and user/password properties -- those are really optional (and useful in certain use cases).

During appliance start, after the network is started, you have to:

determine which network interface is the external one (eth0 in Redhat Linux distros, may vary)
assign the IP address to it and configure the remaining settings (such as the dns)


The external interface is identified in the appliance descriptor (see http://doc.3tera.com/AppLogic24/AdvAPKUserManual.html for details). The IP settings are configured with the "ip add" command; the dns goes traditionally in /etc/resolv.conf (which can be completely re-written, iirc).

That's the logic behind it. I am sure we have some tools/scripts that make this easier to do -- and you can look at the VDS template for example, tracking the execution of the applogic_xxx init scripts. (We do have a prototype of an Ubuntu VDS -- you can request it via our helpdesk).

I will also see if we have or can provide a write up similar to what Jessie described for earlier AppLogic releases (pre-APK).

Just as an aside, the principle for configuring the external interface in Windows is the same; it is just a bit more complicated to do -- and I know our Windows APK includes some helper utilities.

Best regards,
-- Peter

LeoKalev
03-04-2009, 05:34 AM
Important note about Ubuntu (likely applies to other distros that use new versions of 'udev', as well):
The udev service keeps a permanent map between network device MAC addresses and device names. Given that AppLogic assigns MAC addresses dynamically, this will cause all network devices to be renamed when the application is copied, moved or exported and re-imported - therefore in all likelyhood 'eth0' is NOT your external interface.
An easy way to avoid this is to disable UDEV altogether, as it is typically not necessary in a DomU environment. To do this:
* create a static /dev directory (e.g., copy an existing one from a Ubuntu boot with 'find -xdev /dev | cpio -o >file', or create one in any other way you wish). As a minimum, the /dev/ directory should have the standard memory devices (/dev/mem, /dev/null, /dev/zero, etc.), /dev/ptmx, an empty /dev/pts directory and the /dev/hda* devices for your virtual disks.
* disable the 'udev' service
* remove the 'initrd' line from the GRUB configuration (/boot/grub/menu.lst).
* check (and clean up) any stray /etc/modprobe.conf aliases related to network devices.
Note that this will also give you a bit faster boot, and save the disk space for the initrd image. The initrd-less boot works for 'ext2' and 'ext3' file systems only. ReiserFS and other filesystems are not compiled into the kernel image and cannot be used on the boot disk without 'initrd' (but you can still use them on non-boot disks, of course).

PeterNic
03-04-2009, 10:29 AM
Just a clarification on Leo's note: disabling the udev service is not required in order to get the external interface configured (on Ubuntu or otherwise). It is an improvement that he suggests considering, with two advantages: faster boot and more predictable device name (eth0).

If my previous post was insufficient in detail / something you can take and use as is, please let me know

Regards,
--Peter