Internet via Ethernet
- it is assumed that one or more ethernet devices are installed and that one or more static IP addresses are available for use
- review the kernel registration of the ethernet devices during boot by inspecting the relevant parts of dmesg:
eth0: MACE at XX:XX:XX:XX:XX:XX, chip revision 9.64
eth1: DC21143 at 0x1000 (PCI bus 0, device 14), h/w address XX:XX:XX:XX:XX:XX,
and requires IRQ24 (provided by PCI BIOS).
de4x5.c:V0.544 1999/5/8 email@example.com
in this example, eth0 refers to built-in motherboard ethernet, while eth1 refers to a PCI ethernet card, both of which happen to be installed for this discussion. Only one of either may be present, depending on your computer. XX:XX:XX:XX:XX:XX is the MAC address of each interface. de4x5.c is the driver (compiled into the kernel) handling all low-level communication between the ethernet devices and the kernel or other upper level software. The tulip driver is also commonly used.
if no ethernet devices are registered, or no ethernet driver support is compiled into the kernel, none of the configuration options described below will be relevant, with the exception of ppp.
- starting the ethernet interfaces requires that an IP number is assigned to each and that the interfaces are added to the routing table. Each IP address must have an assigned netmask, and the routing table must also contain information about how packets are to be passed out of and into the network.
starting ethernet interface(s)
- Most distributions install network startup scripts that are executed during boot. In the case of RedHat Linux, the files in the /etc/rc.d/rcX.d/ directory are executed at boot, where X is the runlevel defined in /etc/inittab. One of these files is a link to the /etc/rc.d/init.d/network script, which runs /sbin/ifup which in turn runs ifconfig and route for each ethernet device found. If this method is used, configuration files named /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-ethX must be present, constructed as follows:
network: ifcfg-eth0: ifcfg-eth1:
NETWORKING=yes DEVICE=eth0 DEVICE=eth1
HOSTNAME=the_hostname IPADDR=192.168.0.10 IPADDR=192.168.0.1
GATEWAY=192.168.0.10 NETMASK=255.255.255.0 NETMASK=255.255.255.0
GATEWAYDEV=eth0 NETWORK=192.168.0.0 NETWORK=192.168.0.0
(this example assumes the presence of 2 ethernet connections as described above)
- The Linux command ifconfig is used to start an ethernet interface - an appropriate IP address and netmask must be specified; route add -host is used to add the IPs as destinations and route add -net to add the network as destinations (in the absence of a startup script these commands can be entered into /etc/rc.d/rc.local to bring the interfaces up automatically at boot):
/sbin/ifconfig eth1 192.168.0.1 [netmask 255.255.255.0] up
/sbin/ifconfig eth0 192.168.0.10 [netmask 255.255.255.0] up
/sbin/route add -host 192.168.0.1 netmask 255.255.255.0 eth1
/sbin/route add -host 192.168.0.10 netmask 255.255.255.0 eth0
/sbin/route add -net 192.168.0.0 netmask 255.255.255.0 eth1
/sbin/route add default gw 192.168.0.10
- in either method, after boot is finished, the ethernet interfaces are running and entered into the router table, which can be viewed with route -n or netstat -rn:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.10 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.10 0.0.0.0 UG 0 0 0 eth0
the target network
- the network is my SOHO 10base-T LAN connected to the internet by modems. Your network may be different, but most if not all the principles here will apply. Through the magic of IPNetRouter, the LinuxPPC/MkLinux box does not know it is connecting via modem. Although it employs a Mac and modems, it will look to Linux like a normal ethernet connection to the internet. All Linux must know is its IP address and the correct route for TCP/IP packets. The configuration for both are described here. Below is the network with locally assigned IP addresses.
+-+- ppp0 -+------------------+- 28.8 modem -+- internet
6500 (Linux/MacOS8.5.1) 192.168.0.4 -+
Quadra650 (MacOS8.1) 192.168.0.3 -+------ 192.168.0.1 PTP200/G3 (MacOS8.5.1/IPNR) -+- 33.6 modem -+- internet
+ Linux IP: 192.168.0.4
+ Netmask: 255.255.255.0
6500 (MacOS8.5.1) 192.168.0.2 -+ Router IP: 192.168.0.1
- If you skipped the LAN setup in the R4 install or R5 install procedure, this page may help you set it up manually. If nothing else, understanding this page will make you understand your Linux box -so- much more.
- Configuring the ethernet LAN may prevent ppp from working correctly. The reason appears to be that kppp (for example) does not like or want to see routes with bad karma existing in the routing table. Configuring the LAN will do this, so if you're setting up ppp, you may want to look into destroying your routing table.
necessary (device configuration) files
- The kernel at boot configures the loopback address (lo) via the configuration file /etc/sysconfig/network-scripts/ifcfg-lo. Initially, there may be no ifcfg-eth0 for the ethernet interface. Setting up the LAN during the install procedure should create an ifcfg-eth0 file in addition to the ifcfg-lo file. In case it is not, this file (ifcfg-eth0) should reside in /etc/sysconfig/network-scripts/ and should read (substitute network numbers appropriate for your setup) as follows:
#BOOTPROTO=none #R4 only?
Note the comment on the GATEWAY variable. It appears that if this variable is uncommented, the following file may not be necessary.
- The kernel at boot configures the routes table via the configuration file /etc/sysconfig/network. Again, setting up the LAN during the install procedure should create this file. In case it does not, this file should reside in /etc/sysconfig/ and should read (substitute network numbers, hosts, and domain names appropriate for your setup) as follows:
FORWARD_IPV4=false #R5 only?
This file handles the gateway device entry in the routes table.
- a /etc/hosts file may exist; if so, it may read something to the effect of
# IP FQDN alias
127.0.0.1 localhost loopback
192.168.0.1 powercc.home.org powercc
192.168.0.2 6500.home.org 6500
192.168.0.3 quadra.home.org quadra
192.168.0.4 linux.home.org linux
- a /etc/networks file may exist; if so, it should read something to the effect of
# /etc/networks for the home LAN
default 0.0.0.0 # this line not required but is traditional
loopnet 127.0.0.0 # this line not required
homenet 192.168.0.0 # this line not required
- if when using ftp you can log on, and execute certain commands like changing to binary or ascii mode for example, but dir or ls or cd gets you only
200 PORT command successful and 150 opening connection replies
and nothing else, while the network ping is fine, set ftp configuration with the command passive.
- the stability and operation of ethernet on my 6500 has been an incredible ordeal for me. The good side of this is that 3/4 of what I've learned on this web site are a result of sleuthing this problem. Based on correspondence from Paul Mackerras, the problem with the 6500 is due to a cache coherency issue and may affect other machines. A patch can be derived from de4x5.c in Paul's source distribution of 2.1.1. Alternately, as of 2.2.14, the tulip driver appears to be functional. Details.