[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linux hub



On Sb, 04 sep 10, 21:48:16, peasthope@shaw.ca wrote:
> Does anyone know of documentation for a Linux hub or a Linux 
> switch?  The simplest example I can think of is a system with 
> a gateway interface transmitting packets for multiple addresses 
> and subordinate interfaces transmitting packets for one or all 
> addresses except for the address of the machine itself.

Be careful what you ask for, hub/switch in networking context means 
those devices (operating at layer 1 & 2, aka Ethernet in most configs) 
used for physically connecting multiple computers, usually belonging to 
the same layer 3 & 4 network (TCP/IP) ;)

AFAICT, what you ask for is a gateway/router. Here is a very short 
tutorial:

,----[ /etc/network/interfaces ]
| # the Internet interface, assuming a static config
| # as received from the Internet provider
| iface eth0 inet static
|     address xxx.xxx.xxx.xxx   # this is your Internet IP address
|     netmask 255.255.255.0
|     gateway xxx.xxx.xxx.xxx   # this is your gateway to the Internet
|     dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
|
| # internal network, where this computer is the gateway
| iface eth1 inet static
|     address 192.168.0.1
|     netmask 255.255.255.0
`----

Install resolvconf, shorewall, dnsmasq. For shorewall first you need to 
he files contained in /usr/share/doc/shorewall-common/default-config to 
/etc/shorewall/ and then adjust a few of them according to the example 
in /usr/share/doc/shorewall-common/examples/two-interfaces (all paths 
from memory as both gateways I administer remotely are currently 
shut-down). Also don't forget to set IP_FORWARDING=On (instead of Keep) 
in /etc/shorewall/shorewall.conf.

On a client machine you only need the package resolvconf and:

,----[ /etc/network/interfaces ]
| iface eth0 inet static
|     address 192.168.0.xx    # anything else but 192.168.0.1
|     netmask 255.255.255.0
|     gateway 192.168.0.1
|     dns-nameservers 192.168.0.1 # yes, the gateway, because we have dnsmasq
`----

If you want your gateway to also provide DHCP just uncomment one example 
that suits you in /etc/dnsmasq.conf and restart dnsmasq. On the client 
side you only need:

iface eth0 inet dhcp

To connect multiple computers you need an Ethernet switch, preferably 
with auto-crossover or even Gigabit capabilities (a hub would also do, 
but I doubt you can still buy one...). You can also add a network card 
for each additional internal computer and use bridge-utils to create a 
bridge. This way your gateway will also act as a switch ;)

This setup is very flexible and can be extended in several ways 
depending on your needs.

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic

Attachment: signature.asc
Description: Digital signature


Reply to: