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. |
Quote:
|
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 |
Quote:
|
|
Quote:
a typical home setup would look something like this Code:
+- 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] |
Quote:
#!/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... |
Quote:
|
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:
|
Quote:
|
Member Response
Hi,
For a SOHO LAN you can setup '/etc/host' to help facilitate; Quote:
Quote:
Quote:
|
Quote:
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. |
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. |
Quote:
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). |
Quote:
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:
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. |
All times are GMT -5. The time now is 12:13 PM. |