MiNTnet
From SpareMiNT Wiki
In order to use the MiNT networking (MiNTnet) tools, you will need to connect direct to the internet, or through a network that connects to the internet, which includes an ADSL Router. Mostly this is now down with the use of an network card (NIC) or via a device that includes a network connector as part of its design, like NETUS-Bee and EtherNat. However it is still possible to connect to the internet via dialup (modem), using either SLiP, PLiP or PPP.
Contents |
[edit] Choose a Packet Driver
There are quite a few network interfaces supported by MiNT, recognized by the file extension XIF, in the /driver/XIF subfolder included in the FreeMiNT distribution archive. There is also an XIF skeleton driver in the FreeMiNT cvs, so new network drivers can be created as the need arises. The relevant XIF must be present in the same folder as mint.cnf (eg "c:\mint\1-17-0") in order for it to work correctly.
NOTE: Read the associated text file for your selected driver, as they can contain important information.
[edit] Add IP4 Driver
After choosing the correct driver for network connection, you then need to make sure that inet4.xdd (found in /drivers/xdd) is also installed in the same folder as mint.cnf. For those wanting to set up a PPP connection, there is a set of example shell scripts for using PPP under MiNT in the /tools/mgw subfolder included in the FreeMiNT distribution archive. It should work with any SpareMiNT or GentooMiNT installation, as it requires the use of "pppd". At the moment there is no intended support for IP6 addressing using FreeMiNT.
[edit] Hostname, Hosts, Domainname and Nameserver
Most of these are optional, however you should set a nameserver.
[edit] Hostname
Setting of a hostname is optional on almost any enduser computer system, but it can make things look nice especially if you also run network services visible outside your machine (ftp, web server, etc). You can use the hostname binary, or if you have a full SpareMiNT or EasyMiNT installation, you can set the hostname in /etc/sysconfig/hostname.
[edit] Hosts
On a full distribution the hostname is bound to the loopback IP address in the hosts file found in /etc/hosts, so you will see at least two entries: "'localhost 127.0.0.1", "myfalcon 127.0.0.1". the entries found in the hosts file are optional, and valid only for that OS, so you can place your own short names to long internet urls, or block an internet url, if you know the actual IP address: "mysite 196.194.201.33, "ad.doubleclick.com 127.0.0.1". You can use this technique to set up friendly names for any computers on your local network (ie. c:\windows\system32\hosts). If you do not use a hostname or a full SpareMiNT or GentooMiNT installation, but do use a hosts file, it should contain at least: "localhost 127.0.0.1".
[edit] Domainname
This is also optional, but usually set on any Linux or Unix type OS. If you have a full SpareMiNT or EasyMiNT installation, you can set the domain name in /etc/sysconfig/domainname. This setting can be checked and set from the console by executing the domainname binary. A proper setting here can depend on your ISP and/or your DNS hosting service, especially if you provide network services visible on the internet (ftp, web server, FreeCIV server).
[edit] Nameserver
Setting the nameserver IP address is required if you intend to do anything on the internet that uses domain names (url/uri) to find addresses. If you only ever connect via IP addresses, you can probably get away without setting a server address for domain name resolution. If you have a full SpareMiNT, EasyMiNT or GentooMiNT installation, you can set the nameserver IP address in /etc/resolv.conf. On a loacl network, the nameserver IP address is usually the same as the DHCP server, router or hub (if it connect to the internet). You can however set the IP address of ANY name server (NS) on the internet (eg 8.8.8.8 Googles free NS), and you can usually have up to 3 entries in resolv.conf (in case the initial ones are busy).
[edit] Assign IP Address
Having physically connected the network device, with the driver up and running, the next issue is assigning an IP address.
[edit] Dynamic IP Address
This means either running DHCP for a dynamically assigned IP address. If you intend to use DHCP on a full SpareMiNT or EasyMiNT installation, you can uncomment (ie. remove leading hash character from) the line "#dhclient" in the file /etc/sysconfig/net.services.
[edit] Static IP Address
By issuing an ifconfig command with the appropriate arguments if you intend to use a static IP address. Again, both should work with any SpareMiNT or GentooMiNT installation. If you have a full SpareMiNT or EasyMiNT installation, you can set a static IP address in the file /etc/sysconfig/config.if.
[edit] Add Route for Gateway IP
If you manually set your IP address (ie. not using DHCP) then the next step is to add the IP route to the route table, which is used to define the gateway IP address. This is the IP address through which you will gain access to the internet, for local area networks (LAN) this is usually the IP address assigned to your router or hub. If you have a full SpareMiNT or EasyMiNT installation, you can set the IP address details in /etc/sysconfig/defaultroute.
[edit] Enable Application Gateway
After you have your machine connected to the internet, and the IP address method decided on, the next thing is to provide a gateway that supports any applications that might use it. GlueSTiK is currently found in the tools folder of any FreeMiNT distribution archive, which allows internet access to applications and utilities using the STiK or Sting TCP/IP stack. MGW (MiNTnet GateWay), also in the tools folder, allow Draconis clients to be used with MiNT.
[edit] Static IP Address Examples
[edit] Simple Static IP Example
Static IP address, simple /c/bin folder (not full SpareMinT, EasyMiNT, or GentooMiNT):
- /c/mint/1-17-0/ne2000.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
... exec /c/bin/ifconfig en0 addr 192.168.1.28 netmask 255.255.255.0 up exec /c/bin/route add default en0 gw 192.168.1.254 metric 1 ...
- /etc/resolv.conf
nameserver 192.168.1.254
[edit] Full SpareMiNT Static IP Example
Dynamic IP address, full /bin folder (SpareMinT):
- /c/mint/1-17-0/rieblste.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
...
init=init
...- /etc/sysconfig/config.if
... # en0 192.168.0.28 192.168.0.255 255.255.255.0 192.168.0.255
- /etc/sysconfig/defaultroute
... # en0 192.168.0.1
- /etc/sysconfig/net.services
... # #dhclient
- /etc/resolv.conf
nameserver 192.168.0.1
[edit] ARAnyM Static IP Example
Configured to use the "Linux TUN/TAP Tunnel" ptp method, MiNT Static IP address, simple /c/bin folder (AFROS) with STiK/STinG & Draconis application gateways:
- /c/mint/1-17-0/nfeth.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
... exec /c/bin/bash netsetup.sh ... exec /c/mint/glustik.prg exec /c/mint/mgw.prg ...
- /c/bin/netsetup.sh
#!/bin/bash echo -n "Setting up networking: " IP=`nfethcfg.ttp --get-atari-ip eth0` MASK=`nfethcfg.ttp --get-netmask eth0` GW=`nfethcfg.ttp --get-host-ip eth0` echo -n "$IP/$MASK -> $GW " ifconfig eth0 addr $IP netmask $MASK up route add default eth0 gw $GW echo "OK!"
- /c/etc/resolv.conf
nameserver 8.8.8.8
[edit] Dynamic IP Address Examples
[edit] Simple Dynamic IP Example
Static IP address, simple /c/bin folder (not full SpareMinT, EasyMiNT, or GentooMiNT) with Draconis application gateway:
- /c/mint/1-17-0/ne2000.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
... exec /c/bin/dhclient ... exec /c/mint/tools/mgw.prg ...
- /etc/resolv.conf
nameserver 8.8.8.8
[edit] Full SpareMiNT Dynamic IP Example
Dynamic IP address, full SpareMiNT/EasyMiNT with STiK/STinG & Draconis application gateways:
- /c/mint/1-17-0/rieblste.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
...
init=init
...- /etc/sysconfig/config.if
...
#- /etc/sysconfig/defaultroute
...
#- /etc/sysconfig/net.services
...
#
dhclient- /c/etc/resolv.conf
nameserver 8.8.8.8
[edit] ARAnyM Dynamic IP Example
Configured to use the "Windows Internet Connection Sharing" ptp method, MiNT Dynamic IP address, simple /c/bin folder (AFROS):
- /c/mint/1-17-0/nfeth.xif
- /c/mint/1-17-0/inet4.xdd
- /c/mint/1-17-0/mint.cnf
... exec /c/bin/bash dhsetup.sh ...
- /c/bin/dhsetup.sh
#!/bin/bash echo -n "Setting up gateway: " dhclient GW=`nfethcfg.ttp --get-host-ip eth0` route add default eth0 gw $GW #echo "nameserver 8.8.8.8" > /etc/resolv.conf echo "nameserver $GW" > /etc/resolv.conf ifconfig echo "OK!"

