lugoteehalt
03-22-2004, 06:02 AM
Introduction:
I have just set up, as a complete networking newbie, a 2 computer home network. It was a real struggle; it needn't have been. Each computer has an ethernet, NIC, card and the cards are connected with a 'crossover' cable - a 'telephone cable on steroids'. It seemed the documentation had cranked up a level from the normal unintelligibility. The idea of this 'howto' is to be very simple. It is notable that guilds - Selafield name change tricked to 'professional groups' - must hide their knowledge from outsiders. Guilds must run counter to a Linux ethos.
Who Should Read This:
Two computers are joined with a single cable going from the ethernet, NIC, card in one computer to the ethernet card in the other computer. (It therefore needs to be a 'crossover' cable. I understand you could use a hub, a junction box for network cables, and an ordinary cable - in which case it would seem trivial to extend the method to an arbitrary number of computers. Perhaps try two computers first, and if that works, many?). The cable is a 'telephone cable on steroids'. The Linux distribution is Debian. The method is probably about as simple as networks get.
First Give The Computers Names:
When using the network it is easiest to log onto the remote computer using its name. And if both computers have different names it is harder to get mixed up between them. So invent two different names for the computers. I called computer 1 'debian' and computer 2 'apricot'.
You must, as root, edit the computers' /etc/hostname files; just replace the old name with the new. If you wish change the names before you, as you sit, do:
# hostname apricot.
Give The Computers Each Other's Names And Addresses:
Each computer needs to know the name and address of itself and of the other computer. The /etc/hosts file is the list of these names and addresses. Here is my /etc/hosts file after it has been modified:
#lugo The next line is all that was in the file. I am commenting it out.
#127.0.0.1 debian localhost
#
#lugo Put in next block to try to get networking.
127.0.0.1 localhost
192.168.1.1 debian.domain.org debian
192.168.1.2 apricot.domain.org apricot
Put the same changes into both computers. More advanced networks do not use this file. You may choose something else for the domain name, 'domain.org'.
The computers now have names and know their own and each other's names and addresses.
Get The Ethernet, NIC, Cards Working:
The ethernet cards need drivers; need the appropriate modules in the kernel.
If they are working already there will probably be a message at startup: something about eth0, or eth1 perhaps, if there is more than one NIC card in the computer. Doing:
# ifconfig eth0 192.168.1.2 up (the 2 at the end means computer 2 - 'apricot')
followed by doing:
# ifconfig
will give something like:
eth0 Link encap:Ethernet HWaddr 00:60:97:3E:53:F7
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1877 errors:0 dropped:0 overruns:0 frame:0
TX packets:2661 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Note the 'inet addr .... etc.' line in the eth0 block: it must be there.
If you haven’t got modules for the cards installed then you'll have to put them in. Modconf is an easy way. To find which modules are needed you presumably look at the cards; note the data written on them, including what it says on the largest chip; and google. You may know a better way.
Get The Ethernet Cards Up On Startup:
It will usually be easiest to get the NIC cards started up during startup. You can always turn them off subsequently by doing:
# ifconfig eth0 down
Get them up at startup using the file /etc/network/interfaces. Here is my file:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
iface lo inet loopback
#lugo added the next block.
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
The last block was copied from 'man interfaces'.
Install Ssh:
Install the program 'ssh'. You might as well accept the option of starting up the server daemon 'sshd' on startup on both computers; but, strictly speaking, you only need sshd on one of them.
The command 'netstat' is useful. Doing 'netstat -nlp' as root should show sshd listening on 22.
The light on on *both* ethernet cards is good news, but does not guarantee success. It is quite easy not to have the cable fully plugged home.
If you are on computer debian then do:
$ ssh apricot
and you may then log on to apricot in the normal way.
Err....That's It:
It might avoid getting confused about which computer you are on to have different coloured prompts for debian and apricot. In $HOME/.bashrc comment out PS1 and substitute:
PS1="\[\033[1;35m\]\u@\h:\[\033[0m\]\[\033[1;34m\]\w\[\033[0m\]\[\033[1;35m\]$\[\033[0m\] "
Change 1;35 and 1;34 to vary the colours. For example put: PS1="\[\033[1;33m\]\u@\h:\[\033[0m\]\[\033[1;34m\]\w\[\033[0m\]\[\033[1;33m\]$\[\033[0m\] " on the other computer.
Disclaimer:
I fiddled about with all sorts of stuff in my desperate flailing, so some of that may have shot through; but I doubt it. I think the above is what did the job. Peace and love.:)
I have just set up, as a complete networking newbie, a 2 computer home network. It was a real struggle; it needn't have been. Each computer has an ethernet, NIC, card and the cards are connected with a 'crossover' cable - a 'telephone cable on steroids'. It seemed the documentation had cranked up a level from the normal unintelligibility. The idea of this 'howto' is to be very simple. It is notable that guilds - Selafield name change tricked to 'professional groups' - must hide their knowledge from outsiders. Guilds must run counter to a Linux ethos.
Who Should Read This:
Two computers are joined with a single cable going from the ethernet, NIC, card in one computer to the ethernet card in the other computer. (It therefore needs to be a 'crossover' cable. I understand you could use a hub, a junction box for network cables, and an ordinary cable - in which case it would seem trivial to extend the method to an arbitrary number of computers. Perhaps try two computers first, and if that works, many?). The cable is a 'telephone cable on steroids'. The Linux distribution is Debian. The method is probably about as simple as networks get.
First Give The Computers Names:
When using the network it is easiest to log onto the remote computer using its name. And if both computers have different names it is harder to get mixed up between them. So invent two different names for the computers. I called computer 1 'debian' and computer 2 'apricot'.
You must, as root, edit the computers' /etc/hostname files; just replace the old name with the new. If you wish change the names before you, as you sit, do:
# hostname apricot.
Give The Computers Each Other's Names And Addresses:
Each computer needs to know the name and address of itself and of the other computer. The /etc/hosts file is the list of these names and addresses. Here is my /etc/hosts file after it has been modified:
#lugo The next line is all that was in the file. I am commenting it out.
#127.0.0.1 debian localhost
#
#lugo Put in next block to try to get networking.
127.0.0.1 localhost
192.168.1.1 debian.domain.org debian
192.168.1.2 apricot.domain.org apricot
Put the same changes into both computers. More advanced networks do not use this file. You may choose something else for the domain name, 'domain.org'.
The computers now have names and know their own and each other's names and addresses.
Get The Ethernet, NIC, Cards Working:
The ethernet cards need drivers; need the appropriate modules in the kernel.
If they are working already there will probably be a message at startup: something about eth0, or eth1 perhaps, if there is more than one NIC card in the computer. Doing:
# ifconfig eth0 192.168.1.2 up (the 2 at the end means computer 2 - 'apricot')
followed by doing:
# ifconfig
will give something like:
eth0 Link encap:Ethernet HWaddr 00:60:97:3E:53:F7
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1877 errors:0 dropped:0 overruns:0 frame:0
TX packets:2661 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Note the 'inet addr .... etc.' line in the eth0 block: it must be there.
If you haven’t got modules for the cards installed then you'll have to put them in. Modconf is an easy way. To find which modules are needed you presumably look at the cards; note the data written on them, including what it says on the largest chip; and google. You may know a better way.
Get The Ethernet Cards Up On Startup:
It will usually be easiest to get the NIC cards started up during startup. You can always turn them off subsequently by doing:
# ifconfig eth0 down
Get them up at startup using the file /etc/network/interfaces. Here is my file:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
iface lo inet loopback
#lugo added the next block.
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
The last block was copied from 'man interfaces'.
Install Ssh:
Install the program 'ssh'. You might as well accept the option of starting up the server daemon 'sshd' on startup on both computers; but, strictly speaking, you only need sshd on one of them.
The command 'netstat' is useful. Doing 'netstat -nlp' as root should show sshd listening on 22.
The light on on *both* ethernet cards is good news, but does not guarantee success. It is quite easy not to have the cable fully plugged home.
If you are on computer debian then do:
$ ssh apricot
and you may then log on to apricot in the normal way.
Err....That's It:
It might avoid getting confused about which computer you are on to have different coloured prompts for debian and apricot. In $HOME/.bashrc comment out PS1 and substitute:
PS1="\[\033[1;35m\]\u@\h:\[\033[0m\]\[\033[1;34m\]\w\[\033[0m\]\[\033[1;35m\]$\[\033[0m\] "
Change 1;35 and 1;34 to vary the colours. For example put: PS1="\[\033[1;33m\]\u@\h:\[\033[0m\]\[\033[1;34m\]\w\[\033[0m\]\[\033[1;33m\]$\[\033[0m\] " on the other computer.
Disclaimer:
I fiddled about with all sorts of stuff in my desperate flailing, so some of that may have shot through; but I doubt it. I think the above is what did the job. Peace and love.:)