LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 02-13-2013, 10:17 PM   #31
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095

If you want to let the machines connect with each other you have to know the IPs for those machines. So you either have to tell the router that the specific machines always get the same IPs from its DHCP server or you use static IPs for those machines.
In my network (about 16 machines) I use a mixed approach, the Windows machines of my friends get their IPs from the DHCP server of the router, since they don't have the need to let their machines communicate (except with the file-server). My machines (all Linux) have static IPs.
I don't use aliases or something similar, just plain static IPs, set up with NetworkManager on the Slackware systems and /etc/network/interfaces on the CLI-only Debian machine.
 
Old 02-13-2013, 10:23 PM   #32
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by TobiSGD View Post
If you want to let the machines connect with each other you have to know the IPs for those machines. So you either have to tell the router that the specific machines always get the same IPs from its DHCP server or you use static IPs for those machines.
In my network (about 16 machines) I use a mixed approach, the Windows machines of my friends get their IPs from the DHCP server of the router, since they don't have the need to let their machines communicate (except with the file-server). My machines (all Linux) have static IPs.
I don't use aliases or something similar, just plain static IPs, set up with NetworkManager on the Slackware systems and /etc/network/interfaces on the CLI-only Debian machine.
OK. I use (or my ISP uses) DHCP. But the ISP only provides dynamic IPs. Can dynamic IPs work in my case?
 
Old 02-13-2013, 10:26 PM   #33
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
I donot want to confuse you so I use another post. The IPs I simply can get them with ifconfig. That's very easy. For instance:
Code:
root@darkstar:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 576
        inet 190.244.62.185  netmask 255.255.255.0  broadcast 255.255.255.255
        ether 90:2b:34:b8:78:cf  txqueuelen 1000  (Ethernet)
        RX packets 892142  bytes 68344919 (65.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27268  bytes 2892190 (2.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 41  base 0x8000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 40  bytes 2720 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 40  bytes 2720 (2.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
The IP for machine A is then 190.244.62.185. Now if, for intance, I reset the modem, I can get another IP.

Last edited by stf92; 02-13-2013 at 10:31 PM.
 
Old 02-14-2013, 12:28 AM   #34
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Quote:
Originally Posted by TobiSGD View Post
So, yes, they are significantly cheaper.
nice to know it, but is a bit late for me (I needed wireless anyway - bought mine in a supermarket WallMart-like nearby my home, in a non-business day :P)
 
Old 02-14-2013, 12:34 AM   #35
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
http://www.amazon.com/D-Link-DIR-601...ireless+switch R$21.99!
 
Old 02-14-2013, 12:41 AM   #36
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by stf92 View Post
OK. I use (or my ISP uses) DHCP. But the ISP only provides dynamic IPs. Can dynamic IPs work in my case?
what your ISP does in this instance is irrelevant, as that simply provides your INTERNET facing address

a typical home setup would look something like this
Code:
+-
|         {ISP}
|external   |
|(public    /
|facing IP) |
|       <coax>[modem]<ethernet>
+- (DHCP ASSIGNED)      |{dhcp server, or pass-through dhcp from ISP}
|                       |
|                       |{router obtains dhcp from modem or ISP)  
|                       |
|internal               |                          {dhcp server in router firmware}
|(private network)    <wan>[router (with built-in switch]<sw1><sw2><sw3><sw4><wifi>
|(separate IP address from public network)                 |    |    |          ^(wifi signal)
|                                                          |    |    |           
|                                                        [PC1] [PC2][game console]
|
|                                                           (wifi signal)  v       v
|                                                                       [Laptop] [tablet]
+-                                                        {devices obtain dhcp from router}
(yes a typical hous probably wouldn't have THAT many devices, but that's just an illustration)

in this case, the IP your computer(s) has is separate from the one your ISP hands you and the communication between the internet and your devices is handled by the router, this is referred to as a NAT (network address translation)

this also has the added benefit of preventing any unwanted traffic from entering your network (as any inbound traffic has to be explicitly assigned a computer before it is allowed in) (this is called port-forwarding)

granted a significant portion of households are more like
Code:
<ISP>---/---<modem>---[PC]
where the pc would perhaps get it's IP from either the modem or the ISP directly, but the trend is moving more and more towards the above as people have more than one internet connected device (pcs, tablets, laptops, game consoles, blu-ray players etc...

Last edited by frieza; 02-14-2013 at 12:45 AM.
 
Old 02-14-2013, 02:39 AM   #37
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 401

Rep: Reputation: 41
Quote:
Originally Posted by stf92 View Post
Thanks a lot. For the moment I prefer simplicity over effectiveness. So, the hardware conditions are now:


A question: what is, or how do I do an alias of the type eth0:0 192.168.1.1. From the man page for ifconfig, I can do 'ifconfig eth0 <some address>'. Do you mean the alias builtin command?
there is example from my old rc.alias file

#!/bin/sh
#setting up IP alias interfaces
echo "Setting 172.16.41.2, 172.16.41.3, 172.16.41.x IP Aliases ..."
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 172.16.41.2

echo " up aliases"

/sbin/ifconfig eth0:0 172.16.41.3
/sbin/ifconfig eth0:1 172.16.41.4
/sbin/ifconfig eth0:2 172.16.41.5
/sbin/ifconfig eth0:3 172.16.41.6
/sbin/ifconfig eth0:4 172.16.41.7
/sbin/ifconfig eth0:5 172.16.41.8
/sbin/ifconfig eth0:6 172.16.41.9

/sbin/ifconfig eth0:7 172.16.41.10
/sbin/ifconfig eth0:8 172.16.41.11
/sbin/ifconfig eth0:9 172.16.41.12
/sbin/ifconfig eth0:10 172.16.41.13
/sbin/ifconfig eth0:11 172.16.41.14
/sbin/ifconfig eth0:12 172.16.41.15
/sbin/ifconfig eth0:13 172.16.41.16
/sbin/ifconfig eth0:14 172.16.41.17
/sbin/ifconfig eth0:15 172.16.41.18
/sbin/ifconfig eth0:16 172.16.41.19
/sbin/ifconfig eth0:17 172.16.41.20


if you can do net aliase, you can write string similar this ( for your situation) in /etc/rc.d/rc.local file. after restart it can be done setting aliase.

PS aliases not using "in security reasons" - contrary, configuration with cable modem and local machines in one switch is some insecure way to do all. for security networks must be separated and filtereed throught iptables with correct rules.
aliases is used for assign more than one ip address to one ethernet interface. sometimes it be need...

Last edited by WiseDraco; 02-14-2013 at 02:43 AM.
 
Old 02-15-2013, 10:40 AM   #38
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Thumbs up

Quote:
Originally Posted by stf92 View Post
For the moment I prefer simplicity over effectiveness
A router, instead of a switch, is "dead-simple" to setup: it comes with a step-by-step guide very easy to follow (and cam be a wifi-router, providing a Access Point to any wireless device, like nowadays phones and tablets)
 
Old 02-15-2013, 11:10 AM   #39
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
interesting, however i fail to see where interface aliases has ANYTHING to do with the OP's question, the answer is a simple,
modem-router/switch-pc1/2, done
maybe one or both machines need static IP address, but still each machine needs only ONE IP address per machine, interface aliases here would be superfluous.

Quote:
Originally Posted by WiseDraco View Post
there is example from my old rc.alias file

#!/bin/sh
#setting up IP alias interfaces
echo "Setting 172.16.41.2, 172.16.41.3, 172.16.41.x IP Aliases ..."
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 172.16.41.2

echo " up aliases"

/sbin/ifconfig eth0:0 172.16.41.3
/sbin/ifconfig eth0:1 172.16.41.4
/sbin/ifconfig eth0:2 172.16.41.5
/sbin/ifconfig eth0:3 172.16.41.6
/sbin/ifconfig eth0:4 172.16.41.7
/sbin/ifconfig eth0:5 172.16.41.8
/sbin/ifconfig eth0:6 172.16.41.9

/sbin/ifconfig eth0:7 172.16.41.10
/sbin/ifconfig eth0:8 172.16.41.11
/sbin/ifconfig eth0:9 172.16.41.12
/sbin/ifconfig eth0:10 172.16.41.13
/sbin/ifconfig eth0:11 172.16.41.14
/sbin/ifconfig eth0:12 172.16.41.15
/sbin/ifconfig eth0:13 172.16.41.16
/sbin/ifconfig eth0:14 172.16.41.17
/sbin/ifconfig eth0:15 172.16.41.18
/sbin/ifconfig eth0:16 172.16.41.19
/sbin/ifconfig eth0:17 172.16.41.20


if you can do net aliase, you can write string similar this ( for your situation) in /etc/rc.d/rc.local file. after restart it can be done setting aliase.

PS aliases not using "in security reasons" - contrary, configuration with cable modem and local machines in one switch is some insecure way to do all. for security networks must be separated and filtereed throught iptables with correct rules.
aliases is used for assign more than one ip address to one ethernet interface. sometimes it be need...
 
Old 02-15-2013, 11:34 AM   #40
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 401

Rep: Reputation: 41
Quote:
Originally Posted by frieza View Post
interesting, however i fail to see where interface aliases has ANYTHING to do with the OP's question, the answer is a simple,
modem-router/switch-pc1/2, done
maybe one or both machines need static IP address, but still each machine needs only ONE IP address per machine, interface aliases here would be superfluous.
and what way then, one of machines can be in the same time get internet via cable modem ( connect to computer via ethernet) and connection to another local computer? without aliases or buying second NIC for that computer?
 
Old 02-15-2013, 11:53 AM   #41
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,469
Blog Entries: 4

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Member Response

Hi,

For a SOHO LAN you can setup '/etc/host' to help facilitate;
Quote:
excerpt from 'man host'
NAME
host - DNS lookup utility

SYNOPSIS
host [-aCdlnrsTwv] [-c class] [-N ndots] [-R number] [-t type] [-W wait] [-m flag] [-4] [-6] {name} [server]

DESCRIPTION
host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options
are given, host prints a short summary of its command line arguments and options.

name is the domain name that is to be looked up. It can also be a dotted-decimal IPv4 address or a colon-delimited IPv6 address, in which case host
will by default perform a reverse lookup for that address. server is an optional argument which is either the name or IP address of the name server
that host should query instead of the server or servers listed in /etc/resolv.conf.
Don't forget;
Quote:
/etc/host.conf /etc/hosts /etc/hosts.allow /etc/hosts.deny /etc/hosts.equiv /etc/resolv.conf/
Additional helpful info;
You can also look at Network section of Slackware®-Links for some helpful links.
 
Old 02-15-2013, 12:51 PM   #42
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by WiseDraco View Post
and what way then, one of machines can be in the same time get internet via cable modem ( connect to computer via ethernet) and connection to another local computer? without aliases or buying second NIC for that computer?
think about what you're asking for a moment.

you can't plug more than one device into ONE physical port, no matter how many aliases that port HAS, you need a switch.
a router can hand numbers via DHCP and has a built in switch, which covers BOTH requirements, both machines talk to each other, AT LEAST one has internet.. note the original verbiage was AT LEAST ONE, not ONLY ONE.

anyone who says anything about interface aliases are over-complicating the matter for someone who already admits to being a novice.
the next step would be to learn to flash DD-WRT or openwrt on the router and learn how to use iptables to DENY internet access to the other one, but that's a project perhaps for the future.. get the simplest setup working FIRST, then make it more complicated.
 
Old 02-15-2013, 01:24 PM   #43
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,285

Original Poster
Rep: Reputation: 49
OK. I have just called (not trying to contradict anyone) my technician and he says: with the modem and the switch you can do the following: communicate one computer to the other, with one of them enjoying internet (or even the other one too if I remember well). But the machine with internet must be on all the time. That is, if I turn it off, I can't use the other.

Let that be so. Then I do not need anything else. Every time I enter the room with the computers, I just turn "the one" on, and voila! Now, how to set up the software to do it, is something I do not know yet, but methinks it must be extremely easy.

Last edited by stf92; 02-15-2013 at 01:26 PM.
 
Old 02-15-2013, 01:34 PM   #44
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,213

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by stf92 View Post
... But the machine with internet must be on all the time. That is, if I turn it off, I can't use the other.
...
that is why people usually buy a cheap low-power wifi-router (so they dont have to keep their expensive pc on 24/7 and burn electricity).

as far as software goes maybe if you post the output of lspci, ifconfig, ifconfig -a ... of the pc sharing the internet connection maybe someone can suggest a method of getting online on both pc's (the link i provided in my first response to this thread details what i did to get my blu-ray player (netflix/ pandora) to work thru my htpc).

Last edited by schneidz; 02-15-2013 at 01:47 PM.
 
Old 02-15-2013, 01:51 PM   #45
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,111

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by stf92 View Post
OK. I have just called (not trying to contradict anyone) my technician and he says: with the modem and the switch you can do the following: communicate one computer to the other, with one of them enjoying internet (or even the other one too if I remember well). But the machine with internet must be on all the time. That is, if I turn it off, I can't use the other.

Let that be so. Then I do not need anything else. Every time I enter the room with the computers, I just turn "the one" on, and voila! Now, how to set up the software to do it, is something I do not know yet, but methinks it must be extremely easy.
to be more clear, the little Linksys routers you buy off the shelf are in fact nothing more than heavily customized, purpose built computers, designed to do one task and one only, and that is to provide communication between one network (the computers in your house) and another (the internet in this case), but at their most fundamental they are a computer, the advantage though is they are cheaper, and consume far less power than a PC, and require far less configuration than a general purpose computer as most of the work has been done by the manufacturer of the device.

most home routers are just plug and go and should work sufficiently out of box to satisfy the average home user, with that, you can have BOTH machines plugged into the router

the reason for this being, as the technician said, the modem is
Quote:
Originally Posted by technician
with the modem and the switch you can do the following: communicate one computer to the other, with one of them enjoying internet
enter the router, which i already told you was a computer, it acts as a middle man between the router and your other computers, like a person in a bucket brigade, the computer hands the router the data, which then forwards it on to the modem, which then hands the reply to the router, which is forwarded to the proper computer.

essentially the router talks to the modem and 'hides' the rest of rest of the computers behind insofar as the modem thinks there is only one computer in your house as the modem can only see the router, it can't see past the router.

they talk to each other, and both talk to the internet.
you can have one or both on as long as the router and modem have power you have internet.
simple as that.

Last edited by frieza; 02-15-2013 at 01:53 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect ubuntu computers into LAN jennifer.ayag Linux - Networking 3 12-04-2008 07:58 AM
list computers in LAN Lotharster Linux - Newbie 2 01-08-2006 12:10 PM
No Internet but LAN and VPN connect LAN work fine??? xavior Suse/Novell 7 11-09-2005 02:14 PM
KDE Lan Browser doesn't display available LAN computers dance2die Linux - Newbie 2 01-16-2005 09:14 PM
I cannot see my own server from computers on my LAN proroer Linux - Networking 2 09-08-2003 12:33 AM


All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration