smoothie network setup

Lawrence Manning, 21-02-01

1. Intro

GREEN=Local network, ORANGE=DMZ, RED=External.

GPL smoothie should support tripple nic configurations.  As well as the obvious
single, double and tripple NIC setups, a double setup where GREEN and ORANGE
are NICs and the red is via PPP or ISDN is supported.  This is for completeness
and because some people might want this option (it is also included because this
is a nice configuration for me to test here with my ISDN line).

After choosing to change any of the options, external networking will be
unavailable, but the GREEN link will still be up so it is possible to configure
the external and DMZ nics via SSH from the LAN.  When the network configuration
is exited, the modules are loaded again and interfaces are bought up.  This way,
a reboot IS NOT required to activate the changes.

DHCP client is supported only on the RED interface.

It probably wont be possible to change the driver on the GREEN interface.  This
is because this interface must be up when setup is running because otherwise
the user cant configure unless logged in locally, which sucks.

2. Main network setup menu should look like this.

Summary of current config at top.

Menu items:

	a. Number of cards
	b. GREEN network IP address
	c. Additional card drivers and card assignments
	d. Address information

If any of these are chosen, then first of all bring down all interfaces except
GREEN and unload the modules.  Include warning of this.
	
3. Sections

a. Changing the tpye of network setup

	The combinations are:
	
	GREEN (ISDN/MODEM on RED)			Setting type: 0
	GREEN + ORANGE (ISDN/MODEM on RED)	Setting type: 1
	GREEN + RED							Setting type: 2
	GREEN + ORANGE + RED				Setting type: 3

b. Configure the GREEN network IP address.

	This is essentially the dialog from the installer.  This part should come
	with a HUGE WARNING saying if they are logged in from the GREEN network
	then there connection will DIE when they exit setup.

c. Drivers and network assignment

	Display the current settings and allow them to be changed.
	
	Upon change selection, enter driver detection phase:
	
		1. We know how many NICs (excl. GREEN) there should be.  (0, 1, 1 or 2)
		2. Find out how many NICs are found so far (/proc/net/devices).
		3. If it is more then 1, goto 6.
		4. Otherwise, Show a list where they can choose what card, or autoprobe.
		   For the USB ADSL, it should be possible to give this is an additional
		   option and fill COLOUR_DEV and COLOUR_DRIVER out so the startup
		   scripts can be specialcased for it.
		5. Autoprobe: Like in the installer.  It will have to skip the module
		   if it is already loaded.  Same goes for showing them the list.
		6. See how many nics have been detected.  For each one, ask them
		   where it should be connected, remembering those interfaces which have
		   been assigned already.  Write it to the relevent COLOUR_DEV
		   line.  Also write the COLOUR_DRIVER line.  If there are still nics
		   to find, go back to 4.
		   
d. Address information

Should be as simple as displaying each NIC (colour of it) and giving the
network dialog.  The RED one needs the DHCP switch.
	
4. Booting

Before starting, check the CONFIG_TYPE so we know the number of interfaces
needed.

Modules are added in ethX order, so the card will get the correct device name.
Before we load each module, check to see if it is loaded already; if it is, we
can safely skip it.  After loading each module, ifconfig the interface.
Finally add the DEFAULT_GATEWAY, if it is set.

Loading these module and setting the interfaces could be written easiest in
perl, so they might need to be written with that.

index.cgi can easily be modified so it knows to not display PPP stuff for types
3 and 4.
	
5. Settings file:

/var/smoothwall/network/settings

CONFIG_TYPE=n.  This is the setting type (1 to 4) above.
COLOUR_DEV=device for this connection (eg: eth0, or wan (wan is for modem/isdn))
COLOUR_DRIVER=the driver for this interface (or null for modem/isdn) includes
module options.
COLOUR_DHCP=valid for RED only to start with.  If yes, need to run dhcpc to get
the addy.
COLOUR_ADDRESS=
COLOUR_NETADDRESS=
COLOUR_NETMASK=
DEFAULT_GATEWAY=this machine

6. Notes:

It should be pretty easy, in Enterprise, to expand the ORANGE network into
ORANGE1, ORANGE2 etc.
