LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   What is the necessary hardware to connect two computers in a LAN configuration? (https://www.linuxquestions.org/questions/linux-hardware-18/what-is-the-necessary-hardware-to-connect-two-computers-in-a-lan-configuration-4175449922/)

schneidz 02-15-2013 01:47 PM

Quote:

Originally Posted by WiseDraco (Post 4892477)
on other side, you may have a linux boh, who already work at your home 24/7 to serves as your local fileserver, handle as your personal mail \ web \ftp\ dns server, and you can it additionally give a firewall role too ;)

i suggested smoothwall in post #16 but maybe too advanced for op ?

whizje 02-15-2013 01:59 PM

Some providers give 2 ip's. Mine does so that with a switch you are still able to connect 2 pc's to the internet.

frieza 02-15-2013 02:02 PM

Quote:

Originally Posted by whizje (Post 4892488)
Some providers give 2 ip's. Mine does so that with a switch you are still able to connect 2 pc's to the internet.

but that's still up to the internet provider, with a router you can have as many computers connected as the bandwidth of the internet connection allows (you'd probably overload the wan connection before running out of available IPs, especially on a residential internet connection).

stf92 02-15-2013 02:09 PM

Quote:

Originally Posted by frieza (Post 4892479)
... second of all, wi-fi is OPTIONAL unless you have a LAPTOP, TABLET or other portable device, otherwise two PCs in close proximity should be attached to a WIRED router such as a Linksys BEFSR41, which has a 4 port switch, plus a wan port (technically a 5 port switch , with 4 lan ports and the 5th port segmented off as a wan port)

doing it with just the modem and a switch might work but it's wrong.

Please tell me: I can get any of these:
Linksys E2500
Linksys E1200-AR
Linksys E900-AR
Zeppelin 740N
Zeppelin 841N
Zeppelin 941ND

But Linksys are rather expensive. Could some Zeppelin do?

stf92 02-15-2013 02:31 PM

Quote:

Originally Posted by schneidz (Post 4892478)
sorry this thread is very hard to follow (i didnt know you already bought the switch -- then there is no need to use pc-a as a router).
fyi: wifi uses rf.

so you are set up at this point, correct ?
if not all you need to do is plug a cat-5 cable from the internet transceiver to the correct port of the switch (usually colored yellow). then plug a cat-5 cable from the swicth to pc-a and pc-b. then plug in the switch into a wall outlet.

not sure what software you needed...

I did not know there was a special port in the switch. May that's why I haven't been able to make it work yet. The switch is TP-LINK TL-SF1005D.

whizje 02-15-2013 03:00 PM

Only a router has a special wan port, you might try your switch with only one pc connected and if that works you can connect the other pc with a fixed ip. But it is not ideal. If your only intention was to connect the 2 pc's together you are better of with an extra networkcard.

WiseDraco 02-15-2013 03:01 PM

Quote:

Originally Posted by stf92 (Post 4892503)
I did not know there was a special port in the switch. May that's why I haven't been able to make it work yet. The switch is TP-LINK TL-SF1005D.

switch do not have that special ports. looks like shneidz confusing switch with router, who, yes - have a WAN port :D

frieza 02-15-2013 03:10 PM

Quote:

Originally Posted by WiseDraco (Post 4892524)
switch do not have that special ports. looks like shneidz confusing switch with router, who, yes - have a WAN port :D

precisely (though technically a consumer grade router is a layer 3 switch that performs routing tasks, whereas commercial grade routers have two separate interfaces, but... same difference really)

frieza 02-15-2013 03:27 PM

Quote:

Originally Posted by stf92 (Post 4892494)
Please tell me: I can get any of these:
Linksys E2500
Linksys E1200-AR
Linksys E900-AR
Zeppelin 740N
Zeppelin 841N
Zeppelin 941ND

But Linksys are rather expensive. Could some Zeppelin do?

sure it would work, but remember you get what you pay for
i would go with linksys, belkin or netgear personally, never heard of zeppelin

p.s. most wi-fi routers also come with a built-in 4 port switch (which is why wi-fi routers were mentioned in the first place since they have the bonus of giving you the OPTION for wi-fi if you ever needed it, but the radio on wi-fi routers can be shut off if you don't need it)

stf92 02-15-2013 03:48 PM

OK. Now I have what I could buy at a block from home: a TP-LINK [Zeppelin was a typo] TL-WR740N. The two following commands modify the kernel behaviour:
Code:

# ifconfig eth0 192.168.1.1 netmask 255.255.255.0
# route add default gw 192.168.1.1

How can I undone their effect so as to begin again from scratch?

frieza 02-15-2013 04:14 PM

unless you placed them in a script, then restarting the network should do

Code:

#/etc/init.d/network restart

Code:

#/etc/init.d/networking restart

Code:

# service network restart

Code:

# service networking restart
or something like that
(no you don't have to run ALL of those lines, just one of them, it's just that the syntax varies based on which distribution of Linux you are using.
if you're using windows it would be
Code:

c:\> ipconfig /release
c:\> ipconfig /renew

most distributions ship out of box (read, are pre-configured on install) to use DHCP, and most routers out of box are configured to serve DHCP

failing that (unless the commands are in one of your startup scripts), than simply rebooting will do the trick.

stf92 02-15-2013 04:29 PM

Well, thank you very much.

stf92 02-15-2013 04:37 PM

I would like to know how many IPs should I handle for the whole LAN. Suppose 192.168.1.1 is one of them. This would be associated with the MAC on, say, machine A. Then I need, say, 192.168.1.2 for machine B. OK. Now, how many other IPs should I know of?

frieza 02-15-2013 04:44 PM

with 2 computers, a router and a modem, there would be about 5 IPs, but only 3 need to keep track of

the router's Internal IP address (used for accessing the router's configuration page, this is usually 192.168.1.1 by convention
then the IPs of the computers which would be 192.168.1.2 and 192.168.1.3 (or by default 192.168.1.100 and 192.168.1.101 on alot of routers), though you can statically assign them in /etc/network/interfaces (just google that file for the syntax)

some routers can assign IPs on a per mac address, but those are usually the more expensive ones.

the other addresses would be the IP of the router's WAN port and the IP address of the cable modem, (and your public ip which can be found by googling what's my IP), but unless you are running an internet facing server you don't need to know those.

stf92 02-15-2013 05:16 PM

Quote:

Originally Posted by frieza (Post 4892581)
with 2 computers, a router and a modem, there would be about 5 IPs, but only 3 need to keep track of ...

Well, the public IP I can know it with ifconfig. In fact, I did the physical connection and booted A and B. Then run ifconfig in A and saw the public IP. Then the same in B and the same: I had the public IP! ifconfig shows, for A:

inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255


For B:
inet 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255

Of course the configuration is now totally symetric with respect to A, B. I presume the public IP is the broadcast above, and the default A computer IP is 192.168.0.100. Hence that of B is 192.168.0.2. Internet is OK on A, and B.

Next I did 'ping 192.168.0.2' from A and 'ping 192.168.0.100' from B: success. Can I access A's files from B (or viseversa)?

jpollard 02-15-2013 05:27 PM

It is a router only in that it is a network device between an internal network and the cable connection.

The device has only one connection, and that one connection must go to a switch, hub, or computer.

A switch is nice when you have three or more computers attached - you can make independent sessions between two of the computers without impacting the throughput of the third (presumably connecting to a remote system). A hub is simpler, but traffic on any impacts all... And switches have become cheap enough to push hubs out. Operationally, they are equivalent.

Many cable modems include a switch, but for a higher charge...

Switches also tend to have a processing unit on board that provide DHCP capability to simplify host configuration. This also means that SOMETIMES you have to connect to the switch to reset/configure for your own use. This is also needed to set your own password to prevent someone else from taking over your switch. Usually (if the switch is separate from the cable modem as in this case) you must configure the switch properly to communicate with the cable modem.

The usual case is that the cable modem will get its IP number from the cable company. The single internal network is likely configured to use 192.168.0.1 for its IP number (other values are also possible). The switch usually has to talk to the cable modem, and unless the cable modem provides DHCP (usually), then the switch must be configured to use a 192.168.0.2-254 address (this also assumes the switch knows how to use DHCP for the wan connection to get an IP number from the cable modem...).

If the cable modem is using 192.168.0.x network to talk to the switch, then the switch cannot use 192.168.0.x network to talk to computers connected to the switch. Usually the result is to use 192.168.1.x for the internal network (mine does this, even though the modem contains a 4 port switch + wireless).

stf92 02-15-2013 05:43 PM

Thanks jpollard. What I would like to know is if I can now do as if I were the owner of a cibercafe and, from my machine, i can see all the other machines. In windows, for instance, there would be drives D:, E:, F:, ... in the server, representing the clients disks. I presume I would have to know more than I know to do this. NFS can help? More radically. Can I login from B into A? rlogin?

schneidz 02-15-2013 06:03 PM

Quote:

Originally Posted by stf92 (Post 4892608)
...
Next I did 'ping 192.168.0.2' from A and 'ping 192.168.0.100' from B: success. Can I access A's files from B (or viseversa)?

i recommend using sshfs.

stf92 02-15-2013 06:56 PM

I'll try rlogin. I have been reading the manual and see that you must supply 'host' as an argument. I.e., the minimal syntax is 'rlogin <host name>'. Now, I've found this is the username people in the other machine (machine B) uses to just login (let's call it selui). And let B have IP 192.168.02. How do I associate this IP with hostname (i.e., username) selui?

whizje 02-15-2013 07:03 PM

Code:

username@hostname or username@ip

stf92 02-15-2013 07:15 PM

I consistently get 'Unknown host'. Should I not modify /etc/hosts?

whizje 02-15-2013 07:23 PM

If you have not modified /etc/host you can use the usename@ip but the other computer must allow access.

stf92 02-15-2013 07:30 PM

I used that form. A has 192.168.0.100, B has 192.168.0.2. In B I issued 'rlogin sem@192.168.0.100', where sem is a user in A, and I got 'Unknown host'.

EDIT: if only rlogin had a good tutorial but I don't seem to find one.

stf92 02-15-2013 08:35 PM

Code:

Polling for DHCP server on interface eth0:
dhcpcd[1505]: version 5.5.6 starting
dhcpcd[1505]: all: not configured to accept IPv6 RAs
dhcpcd[1505]: eth0: waiting for carrier
dhcpcd[1505]: eth0: carrier acquired
dhcpcd[1505]: eth0: broadcasting for a lease
dhcpcd[1505]: eth0: offered 192.168.0.100 from 192.168.0.1
dhcpcd[1505]: eth0: acknowledged 192.168.0.100 from 192.168.0.1
dhcpcd[1505]: eth0: checking for 192.168.0.100
dhcpcd[1505]: timed out
dhcpcd[1505]: allowing 8 seconds for IPv4LL timeout
dhcpcd[1505]: eth0: leased 192.168.0.100 for 7200 seconds
dhcpcd[1505]: forked to background, child pid 1552
Starting Internet super-server daemon:  /usr/sbin/inetd

This exactly matches frieza's remarks. The whole process is made perfectly clear by the block code!

frieza 02-15-2013 09:02 PM

Quote:

Originally Posted by stf92 (Post 4892677)
I used that form. A has 192.168.0.100, B has 192.168.0.2. In B I issued 'rlogin sem@192.168.0.100', where sem is a user in A, and I got 'Unknown host'.

EDIT: if only rlogin had a good tutorial but I don't seem to find one.

you probably won't find many rlogin tutorials anymore as it has been obsolete for some time now and has been replaced by SSH (yes you can still use rlogin but SSH is more flexible and is much easier to use).

stf92 02-15-2013 09:09 PM

Yes, slogin (secure login) (ssh). I found a book from TLDP explaining slogin and ssh too. It's only a matter of dedicating some weeks, then. But is wonderful linux did it all by himself. I mean connecting A, B with the modem and A, B with each other given I could ping. When booting, I say.

WiseDraco 02-16-2013 02:38 AM

Quote:

Originally Posted by stf92 (Post 4892550)
OK. Now I have what I could buy at a block from home: a TP-LINK [Zeppelin was a typo] TL-WR740N. The two following commands modify the kernel behaviour:
Code:

# ifconfig eth0 192.168.1.1 netmask 255.255.255.0
# route add default gw 192.168.1.1

How can I undone their effect so as to begin again from scratch?

i think, i prefer one with 3G ability thought USB modem.
TP-Link TL-MR3220
it is not more price, but have a good additional feature.
that command can undone with restart. after restart you have lost that changes

PS for login use "ssh 192.168.0.100"
for ocassionally file copy see the "scp" command - copy files from one machine to another via ssh.
for frequent files exchange i think, is be good to set up fileserver - on samba ( windows smb file sharing protocol ) or via nfs - linux native...

stf92 02-16-2013 02:49 AM

Thank you. It's the way I chose (restart). For the router, too late, but I would not miss USB. Too much complicated electronically and infinite complicated software, no matter how fast.

frieza 02-16-2013 06:54 AM

Quote:

Originally Posted by stf92 (Post 4892807)
Thank you. It's the way I chose (restart). For the router, too late, but I would not miss USB. Too much complicated electronically and infinite complicated software, no matter how fast.

actually it only sounds complicated, but it would be just a matter of plugging in the 3g modem and inputting a username/password into the router's web based configuration.
that being said, i believe a decent speed cable modem is faster, 3g service tends to be more expensive, and the only real advantage of 3g is mobility, unless it's the only type of service available in your area.
either way, if you don't need it, then it's not worth paying for, no matter how cheap.

stf92 02-16-2013 07:06 AM

Thank you. By the way, how do I know the fully qualified hostname of my machine (FQHN)?

EDIT: I have just learned it.


All times are GMT -5. The time now is 11:45 PM.