You are not logged in.

#1 2005-06-08 11:14:42

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

How to setup LAN?

I have never linked two Linux machines (local). How to?

Offline

#2 2005-06-08 11:56:28

mercy
Member
Registered: 2004-04-24
Posts: 62

Re: How to setup LAN?

what do y mean with linking ?

simple ethernet-connection?

Offline

#3 2005-06-08 15:39:37

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How to setup LAN?

Simplest is a crossover cable, connecting the two ethernet cards directly. And then in oneb ox set the other as the default gateway, and in the other enable forwarding and do SNAT or masquerading in iptables.

Offline

#4 2005-06-08 19:17:07

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 545

Re: How to setup LAN?

Yes, but that way he is going to need to have the gateway (the one with internet) always on.

The best thing is to buy a little 4port switch. they are cheap, and you get to poweroff any of the PC without problems. Also, you will probably save on 1 ethernet card, as most PCs have only 1.

Do you want to share files? printer? internet? whats the porpouse of the network?

regards.


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#5 2005-06-08 20:49:55

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How to setup LAN?

Good point sud_crow, though why would you need two comps if one isn't always up? ;-) But I see your point.

Offline

#6 2005-06-08 20:55:49

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: How to setup LAN?

I'd go with sud_crow's plan, alright, but like he said, it would help to know a bit more about your objective here.

Offline

#7 2005-06-09 10:39:18

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: How to setup LAN?

sud_crow wrote:

whats the porpouse of the network?

To run one postgresql database program with php/html interface. The second computer does the editing and new data entries.

I am aware the setup is simple, but never done in Linux but in Windows. Wanted to know if there is/are anything in particular needed to do beside configuring Ethernet and connect with a LAN cable.

Offline

#8 2005-06-09 11:33:01

Michel
Member
From: Belgium
Registered: 2004-07-31
Posts: 286

Re: How to setup LAN?

Heya,

can't help you a lot with this ... mayeb someone else, but this seems a good situation to use zeroconf. Using zeroconf, you won't have to configure anything normally (except maybe zeroconf ...).

Michel

Offline

#9 2005-06-09 18:08:17

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: How to setup LAN?

rasat wrote:

Wanted to know if there is/are anything in particular needed to do beside configuring Ethernet and connect with a LAN cable.

Not really.
Just configure both boxes in /etc/rc.conf (as 192.168.xxx.1 and 2). Connect both network cards with a crossover cable (important!) or use normal ethernet cables connected to a switch.
You could also add items (on both boxes) to your /etc/hosts to have both of them accessible as names not only IPs.

Offline

#10 2005-06-10 08:13:45

Michel
Member
From: Belgium
Registered: 2004-07-31
Posts: 286

Re: How to setup LAN?

Heya,

I was wondering ... I believe with apple's OS/hardware it is possible to use the other cables(no crossover) to conenct 2 computers directly. Anyone know how that works?

thanks,

Michel

Offline

#11 2005-06-10 12:17:09

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: How to setup LAN?

You can make a direct connection between two comps with USB or firewire cables too yes, if that's what you mean.

You need to compile the support for it in your kernel (or as module if that's possible).

Offline

#12 2005-06-17 06:38:21

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: How to setup LAN?

lanrat wrote:

Just configure both boxes in /etc/rc.conf (as 192.168.xxx.1 and 2). Connect both network cards with a crossover cable (important!) or use normal ethernet cables connected to a switch.
You could also add items (on both boxes) to your /etc/hosts to have both of them accessible as names not only IPs.

In Mauritius where I was suppose to setup the LAN, I didn't get time to configure except installing the ethernet cards and link with a LAN cable. Now I have to communicate by e-mail (to a person who has not used Arch).

Is this correct?
Machine 1 (server).
/etc/rc.conf

#
# Networking
#
HOSTNAME="consultation"

lo="lo 127.0.0.1"
eth0="eth0 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(lo eth0)

/etc/hosts

127.0.0.1        localhost.localdomain    localhost
192.168.0.1    consultation.consultationdomain  consultation

Machine 2.
/etc/rc.conf

#
# Networking
#
HOSTNAME="maintenance"

lo="lo 127.0.0.1"
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(lo eth0)

/etc/hosts

127.0.0.1        localhost.localdomain    localhost
192.168.0.2    maintenance.maintenancedomain  maintenance

1. Booth both machines (auto loads ethernet modules, httpd and postgresql)
2. In machine 2
# dhcpcd eth0
Run the database php/html page in a browser:
http://consultation/pow/index.php
3. In machine 1
(no dhcpcd and locally run the db page)
http://consultation/pow/index.php

Offline

#13 2005-06-17 10:49:28

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: How to setup LAN?

I'm not sure if I understand everything correctly.
Mostly it looks ok until you mention dhcp.

If you have only these two machines you don't need dhcp at all (and we are still talking about LAN with no internet gateway right?). If you are going to use dhcp (for whatever reason) the configuration will be different especialy for the "client" machine (that's what dhcp does - it automatically configures net on a client machine).

I'm assuming you don't have internet there (and no dns servers too) and that you have only these 2 machines (1 server AKA "consultation" + 1 client AKA "maintenance") in a LAN.

In this case both of your rc.conf fragments are ok (what about ROUTES=(!gateway) part ?)
The only thing you should change is to have this /etc/hosts on both machines:

127.0.0.1      localhost.localdomain   localhost 
192.168.0.1    consultation.consultationdomain  consultation
192.168.0.2    maintenance.maintenancedomain  maintenance

so "maintenance" machine will be able to call http://consultation/pow/index.php

(And don't run dhcp daemon on the server - it's not necessary).
I hope that's what you want to do.

Offline

#14 2005-06-17 11:06:34

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: How to setup LAN?

lanrat wrote:

In this case both of your rc.conf fragments are ok (what about ROUTES=(!gateway) part ?)

Thanks!
Anything in particular to be done with ROUTES? Currently /etc/rc.conf in both machines, use the same deafult setting:

gateway="default gw 192.168.0.1"
ROUTES=(!gateway

About the dhcpcd, I got confused when seeing dhcpcd configure in different samples when browsing in Internet. The two machines are not connect to Internet.

Offline

#15 2005-06-17 12:08:57

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: How to setup LAN?

rasat wrote:

Anything in particular to be done with ROUTES? Currently /etc/rc.conf in both machines, use the same deafult setting:

gateway="default gw 192.168.0.1"
ROUTES=(!gateway

No I don't think you should change ROUTES. It's needed when the server is also a gateway to the internet for example, so the client machine knows that every packet to IP outside the range of LAN should go through gateway and not directly. You should be fine with ROUTES=(!gateway).

Offline

#16 2005-06-17 15:26:39

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: How to setup LAN?

Thanks, I am sure it will work. If anything comes up, I will post it here. This thread will be my future LAN reference page. smile ... maybe useful to someone else too.

Offline

Board footer

Powered by FluxBB