Network setup a Mini Howto for linux. (I am using ubuntu 7.04 and kde) :-) Back to Main Page
This is a very short version, and if you want to know more, go to the Internet etc.
This howto is without any guarantee, and you may use it on your own responsibility only.
There may be errors, but I do not want to use too much time to write this howto.
To check specific words you may try: http://en.wikipedia.org/wiki/Main_Page (search).
Index Of Page:
The necessary settings
My Setup
D-link
Wireless G
To setup the network
/etc/hosts set up file
/etc/resolv.conf
To connect the two computers
The "nautilus" filemanager
To do some commands on the other computer
This is to show, how I sat up my small private home network, consisting
of a desktop pc and a laptop, but you can have more than two computers
in your network.
The necessary settings:
IP address like "192.168.0.100" (the address of the computer - use an address between 192.168.0.100 - 192.168.0.199)
Hostname like "niels3-desktop" (the host address of the computer - could be any name e.g.: "black", "joe", "house" or "hpubuntu")
Domainname like "localdomain" (but could any name)
Netmask "255.255.255.0" (just
use this number/address)
Back to the Index of Page
Default gateway "192.168.0.1"
(use this number/address - the address of my router [ I use D-link
Wireless G DI 524 ] - could be 192.168.1.1)
My Setup:
Desktop pc:
Laptop pc:
IP address:
192.168.0.100
192.168.0.101 (Each
computer its own individual IP address)
Hostname:
niels3-desktop
hpubuntu
(Each computer its own individual
hostname)
Domainname:
localdomain
localdomain
(Same domain name for all computers)
Netmask:
255.255.255.0
255.255.255.0 (Same netmask for all computers)
Default Gateway:
192.168.0.1
192.168.0.1
(Same default gateway for all computers)
I have connected both computers to the D-link router with cross
over cables (the coloured wires sits differens in each end) - the
D-link is
already set up from the factory, so it is ready to use as is, from new (but can you can change the settings, if you like).
The D-link router is connected with a straight line cable to the adsl modem (the small box connected to my telephone plug).
To setup the network on my desktop choose: K menu - Network - [insert password] - Network Settings (above)
As you can see, I have a wired connection on "eth0" - the small box to
the left is marked.
Back to the Index of Page
You also see an "eth1" line which is not marked (I have two network cards in my desktop) - means not in use.
Click on the "Properties" button:
Configuration Connections (above):
Choose "Static IP address" (use static, as dhcp [dynamic] changes, and
is no good for connecting computers in a local network).
IP address: 192.168.0.100 (insert the IP address for the desktop - individual address)
Subnet mast: 255.255.255.0 (same for all computers in the local network)
Gateway address: 192.168.0.1. (address of the router - same address for all computers in the local network).
Configuration General (above):
Back to the Index of Page
Host name: niels3-desktop - individual name for each computer (your
choice, hostname of the desktop computer, probably already chosen by
you
during installaltion of ubuntu)
Domain name: "localdomain" - same name for all computers in the local network (your choice)
Configuration DNS (above):
DNS Servers: These figures I have gotten from my Internet Service Provider, and are different for other providers.
To add an address, click on the "Add" button and insert the address -
Enter (one address at a time - best with a minimum of 2 DNS addresses)
Open a bash konsole shell and write the following command "sudo nano /etc/hosts" (below):
niels3@niels3-desktop:~$ sudo nano /etc/hosts
Back to the Index of Page
Insert the following lines in the /etc/hosts set up file (see above):
192.168.0.100 niels3-desktop niels3-desktop.localdomain
192.168.0.101 hpubuntu hpubuntu.localdomain
Note: "192.168.0.101 hpubuntu hpubuntu.localdomain" is the line for the
other computer in the local network, so the desktop later can find it.
Then do: "ctrl+x - y - enter" (to save the edited file).
My laptop in not set up with a static IP address, but with a DHCP (Dynamic) IP address, as I have some problems.
I can however connect to the desktop (with its static address) fram the laptop, and I can thus move files both ways.
The above is the principle for making a small network, and I hope it will give you the idea.
Both computers have the same /etc/hosts -and /etc/resolv.conf files (same contents).
I explain it like this, as I am not certain of everything -and how it
works.
Back to the Index of Page
Now to connect the two computers on the local network the following two
packages has to be installed on both computers (I use synaptic
to install packages/programs):
"openssh-client" (normally installed by default in ubuntu)
"openssh-server"
I open the "nautilus" filemanager on the Laptop - possible open a bash konsole and write nautilus on the command line - enter:
and then in the Nautilus filemanager I choose: File - Connect to server (see below)
Service type: SSH - the connetion protocol to use for ssh
communication
Back to the Index of Page
Server: The host name of the other computer
Port: 22 (default ssh port)
Folder: /home (the folder to be opened in the other computer - your choice)
User Name: niels3 the name you want to be logged in as - demands that the user already is created on the other computer
Name to use for connection: Here you can give a name you like for
the connection e.g. "desktop" - otherwise a name will be created
automatic.
Then you will see the connection i the left window og the Nautilus file manager

Back to the Index of Page
Click on the "home on niels3-desktop" icon to left (black incircled),
and you will be brought to the /home folder of the desktop.
Click "ctrl+n" and a new window will open, and you can change directory
as you like, and then copy/move files/directories as you like.
To do some commands on the other computer (desktop) do following on the bash shell command line:
$ ssh -Y -l niels3 niels3-desktop (see "man ssh" for the options "-Y" and "-l")
Then (after having given the user password) you will end up on the other computer's command line.
In order to start "konqueror" on the other computer (and do some surfing) do following on the command line:
$ konqueror
And then you can work, as if you were sitting at the keyboard of the other compter.
You can start other programs as well.
When finished, just write "exit" or "logout", and you will be back at the command line of the laptop.
Note: I can get onto the Internet both using dhcp IP or static IP, via the router and adsl modem.
There are other network-set-up programs, but the principles are all the same.
Back to the Index of Page
9/2007