# Aros/User/Networking

AROSTCP is the TCP/IP stack of choice for AROS based computers.
It is a port of the AmigaOS AmiTCP TCP/IP subsystem to AROS by Neil Cafferkey.
Since its initial port it has undergone a number of changes based on work by AROS developers, as well as backported changes from the MorphOS port (Pavel Fedin - SonicAmiga) it spawned.

## AROSTCP Files

AROS has a Network prefs located in the Prefs directory. Please use it to set up internet/ethernet use.
AROSTCP is located in 'Extras/Networking/Stacks/'. It consists of the following directories and files:
C/ contains networking executables, mostly as known from UNIX/Linux.
S/ contains start and stop scripts
db/ contains configuration files, see AROSTCP Configuration Database.

## AROSTCP Environment Variables

AROSTCP uses a few Env: settings to control its most basic operation.
Currently the following options exist..
File:AROSTCP-Warning.jpg Presently the SetEnv command wont make the AROSTCP drawers to store the settings in - so you may need to manually create them before hand using

## AROSTCP Configuration Database
### Configuration Database Location(s)

The Configuration files are installed to "<AROSTCP DIR>/db" by default - and unless the "AROSTCP/Config" Env variable is set, AROSTCP will attempt to load them from there.
It is preferable however to leave these files, and customize a copy which will not get overwritten when updating AROS/AROSTCP. From hereon in we will refer to this location as <db Dir>.
To do this enter the following at a shell prompt..
.. substituting <AROSTCP DIR> with the location AROSTCP is installed to (for instance "SYS:Extras/Networking/AROSTCP" by default), and <db Dir> with a location of your choice for your personalised config files (i.e. "SYS:Storage/NetConfig").

### Customising the Configuration Database

Most modern home networks provide DHCP addressing/configuration to ease setup of internet access for users. If you use this on your network - or arent sure then this is the configuration option you should most likely use.
For more advanced/experienced users there is manual ip configuration for a brief summary of configuration options required to get AROSTCP working with custom IP address etc.

#### Basic Configuration - DHCP

AROS has a Network prefs located in the Prefs directory. Please use it to set up internet/ethernet use.

#### Basic Configuration - Manual IP

AROS has a Network prefs located in the Prefs directory. Please use it to set up internet/ethernet use.
At a bare minimum the following files will need to be edited to enable operation on your network.
These will provide the necessary information to allow AROSTCP to correctly configure your hardware and network environment.

##### <db Dir>/interfaces

This file contains lines to configure the network hardware on your system. each line consists of the following:
i.e.
Would provide an interface named "eth0" which uses unit 0 of pcnet32.device (PCNet32 compatible controllers), configures it for the IP address 192.168.0.10, and sets the device to go active (UP) immediately.

##### <db Dir>/static-routes

At the moment this file only provides the IP address of your gateway device (DEFAULT GATEWAY) - so make sure and change it to suit your network.
You can add any routes your network needs to this file.

##### <db Dir>/netdb-myhost

netdb-myhost provides name resolution details for your network environment. If your IP address' DNS name cannot be resolved from the nameservers, then you will need to specify it in here.
presently the following data is needed:
specifies the hostname for the interface we configured in <db Dir>/interfaces which has the IP address 192.168.0.10
This is the network our machine belongs to.
The NAMESERVER option lets us specify DNS servers which AROSTCP will use to resolve names (such as www.aros.org)
depending on your configuration this will be set to one of the following -:
* Your private network's DNS servers IP
* Your routers IP address if it can forward DNS requests
* DNS server address's provided by your ISP.
N.B: It is perfectly legal to list more than one NAMESERVER line for multiple DNS servers.

#### Basic Configuration - Linux hosted: tap.device

To be able to use networking under AROS Linux hosted, a "tap.device" has been created, which attaches a Linux tunneling device on the hosting machine to AROSTCP inside the hosted AROS system.

##### Linux Tap/Tun Configuration

You need 'tunctl' to create a tunneling network device under Linux. You might need to install it - it can be found e.g. as part of the uml-utilities package.
A command line to create the device might look like this:
This allows a user called 'arosuser' access to a newly created network device called 'aros0'.
Next, assign an IP address to the device, and bring it up:
tunctl also creates a linux filesystem entry, e.g. /dev/net/tun (see tunctl help for more), you might need to set access privileges for your user, e.g.:
This allows read and write access for all users.
Now you're ready to run AROS.
Finally, after running AROS and starting AROSTCP, you might need to set a route to the hosted AROS system. Use the IP address from your <db Dir>/interfaces configuration (e.g. 192.168.0.188):

##### AROSTCP Configuration for tap.device

The general configuration is done as usual (see section Basic Configuration - Manual IP).
Use these values where appropriate:
* <db Dir>/interfaces : "tap.device" should be used as the interface device driver. The unit number is the same as the Linux network device's number that was created with tunctl.
* <db Dir>/static-routes : The DEFAULT GATEWAY Address to be used is the IP address of the tunneling device under Linux.

#### Advanced Configuration

To be written ..

## AROSTCP Supported Platforms

AROSTCP has been successfully compiled and tested on the following systems-:
* x86 32bit
* x86 64bit
* SAM440EP

## AROSTCP Supported Hardware

AROS contains a number of drivers to support network hardware. Networking drivers are installed to "DEVS:Networks/" by default, and currently the list of supported drivers include..

### PCI NIC Drivers
#### etherlink3.device

    For almost all 3Com NICs

#### intelpro100.device

    For NICs based on the Intel Pro/100 family of controllers including:
    0x8086, 0x1229 - Intel i82558 10/100 PCI Ethernet Controller (untested)

#### pcnet32.device

    For NICs compatable with the PCNet32 family of controllers including:
    0x1022, 0x2000 - 79c970 AMD Lance/PCI (untested)
    0x1022, 0x2001 - 79c978 AMD Lance/HomePNA (untested)
    0x1022, 0x2625 - AMD Lance/PCI PCNet/32 (untested)

#### viarhine.device

    For Chipsets compatable with VIA Rhine Adaptors including:
    0x1106, 0x6100 - VIA VT86C100A Rhine-II (untested)
    0x1106, 0x3043 - VIA VT3042 Rhine (untested)
    0x1106, 0x3065 - VIA VT6102 Rhine-II/VT6103 Tahoe 10/100M Fast Ethernet Adapter (untested)
    0x1106, 0x3106 - VIA VT6105 Rhine-III Management Adapter (untested)
    0x1106, 0x3053 - VIA VT6105M Rhine-III Management Adapter (untested)

#### sis900.device

    SiS900/SiS7016 NIC Driver
    0x1039, 0x8168 - SiS 900 PCI Fast Ethernet (tested - working on i386)
    0x1039, 0x7016 - SiS 7016 PCI Fast Ethernet (untested)

#### rtl8168.device

    Realtek 8168/8111 NIC family driver
    0x10ec, 0x8168 - Realtek 8168B/8111B PCI-e Gigabit Ethernet (tested - not working on amd64 (trapping at driver load when booting))
    0x10ec, 0x8168 - Realtek 8168C/8111C PCI-e Gigabit Ethernet (tested - working on i386)
    0x10ec, 0x8168 - Realtek 8168CP/8111CP PCI-e Gigabit Ethernet (untested)
    0x10ec, 0x8168 - Realtek 8168D/8111D PCI-e Gigabit Ethernet (untested)

#### rtl8139.device

    Realtek 8139 NIC family driver
    0x10ec, 0x8129 - RealTek RTL8129 (untested)
    0x10ec, 0x8138 - RealTek RTL8139 (untested)
    0x10ec, 0x8139 - RealTek RTL8139 (untested)
    0x10ec, 0x8139 Rev:20 - RealTek RTL8139C (untested)
    0x1113, 0x1211 - Accton EN-1207D Fast Ethernet (untested)
    0x1186, 0x1300 - D-Link DFE-538TX (tested - working on amd64)
    0x018a, 0x0106 - LevelOne FPC-0106Tx (untested)
    0x018a, 0x0106 - Compaq HNE-300 (untested)

#### nforce.device

    For NICs based on the nVidias NForce family of controllers including:
    (pci _ id) - Card Name (tested)
    (pci _ id) - Card Name (untested)

#### prm-rtl8029.device

    For NICs based on the Realtek RTL8029 family of controllers including:
    (pci _ id) - Card Name (tested)
    (pci _ id) - Card Name (untested)

#### prism2.device

    For WLAN Adaptors based on the Prism II chipset:
    (pci _ id) - Card Name (tested)
    (pci _ id) - Card Name (untested)

### USB Nic Drivers

See here http://en.wikibooks.org/wiki/Aros/Platforms/AROS_USB_support

### Drivers in Development
#### PCI Nics
#### Efika
## Network Troubleshooting
### Configuration and Basic connectivity issues
#### Check your environment

Before doing anything, its best to check AROSTCP has the correct ENV settings
After checking, change to the directory AROSTCP is installed to and type
AROSTCP should now load, and return you to the command prompt.

#### Check your Interfaces

Now you may wish to verify your network card is operational using
which should output something similar to the following
Look for the "UP" flag which will tell you if your interface is running, and if not check if inet = 0.0.0.0. If this is the case AROSTCP likely couldn't load the driver for your interface so check your interfaces file is configured correctly for your hardware.
If there is a correct inet address but the interface isn't "UP" - try the following command.
Then check your interfaces again.

#### Check your Gateway

If your connected to the internet via a router its IP address should be stored in <db Dir>/static-routes.
We can check if its working by trying to ping it
Which should respond and inform us of received packets (ones sent back)
If you do not get packets back then check your cabling is correct.
The next step requires an external IP address (i.e. one from an internet based site) here I will use www.yahoo.com's current IP [69.147.114.210]
Again, you should get packets received from this operation signaling success.
If it returns "no route to host", you may have an incorrect setting in db/static-routes or an incorrectly configured interface - so please check.

#### Check Name resolution

DNS server s are stored in your <db Dir>/netdb-myhost file
To test they are working simply ping an external site by name ..
And you should get returned packets.