Duke Robillard <(E-Mail Removed)> wrote:
>Ian Northeast wrote:
>>Duke Robillard wrote:
>>>Chen Bin wrote:
>>>>I am using debian 3.0 as my linux PC and I want to study the linux
>>>>network administartion. When I only have one pc, is it possible for me
>>>>to study it on this only one PC?
>>>>
>>>>Is any emulation that can be done to construct a virtual network within
>>>>my PC?
>>>
>>>Here's a possibility: get a second PCI NIC card, and plug it into your PC
>>>(if you don't already have one, get two). Give it an IP address. Your PC
>>>now has two physical network interfaces. connect them with a crossover
>>>cable, and bang, you've got a real, physical network.
>>
>> Over which no traffic will flow at all, as the kernel is
>> intelligent
>> enough to recognise local traffic and not send it all the way down the
>> stack to the hardware layer.
>
>Well, that sucks. :-)
Actually that is a *very* good thing.
>Hmmm...maybe if you added one of those little $50 NAT/"Router" boxes
>from Linksys or D-Link or someone, and plugged into that instead of
>using a crossover? Seems like that would make the destination non-local.
Still won't work, because the two interfaces used on the PC are
both known by the kernel. You simply cannot address a packet
*to* a local IP address and have it routed anywhere except the
loopback device.
Which isn't really that much of a problem... There are at least
two ways to emulate a network.
(But first, note that in many areas it might be easy to find an
old PC (anything from an 80386 up to a Pentium I will be
considered virtually useless for anything else). That would
provide a hardware based system to experiment with.)
Absent a hardware solution, the /lo/ device and the /dummy/
device can both be used. With the dummy device several virtual
interfaces can be configured, just as if they were connected to
a physical network. An example:
In /etc/hosts have the following,
192.168.3.1 host0.dummy.com host0
192.168.3.2 host1.dummy.com host1
192.168.3.3 host2.dummy.com host2
192.168.3.4 host3.dummy.com host3
And then configure each as a different interface,
/sbin/ifconfig dummy0 host0 broadcast 192.168.3.255
/sbin/ifconfig dummy0 host1 broadcast 192.168.3.255
/sbin/ifconfig dummy0 host2 broadcast 192.168.3.255
/sbin/ifconfig dummy0 host3 broadcast 192.168.3.255
With the lo device, note that it is configured with a network mask
of 255.0.0.0, which means that *any* IP address in the 127.x.x.x
range will be a loopback. The /etc/host file can assign names
to to 127.0.0.5, 127.0.1.5, and so one. Hence the /etc/hosts
file could have,
127.1.2.1 host0.dummy.com host0
127.1.2.2 host1.dummy.com host1
127.1.2.3 host2.dummy.com host2
127.1.2.4 host3.dummy.com host3
With all of the above, there are essentially two subnets, each
with 4 hosts.
--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)