linux basic networking
TRANSCRIPT
Author: az_joynare
Linux Basic Linux BasicNetworkingNetworking
December, 29th 2007
setting up netkitsetting up netkitdownload the three files that make up the download the three files that make up the distributiondistribution
netkitX.Y.tar.bz2netkitX.Y.tar.bz2 netkitfilesystemFX.Y.tar.bz2 (warning: >100MB)netkitfilesystemFX.Y.tar.bz2 (warning: >100MB) netkitkernelKX.Y.tar.bz2netkitkernelKX.Y.tar.bz2
unpack them in the same locationunpack them in the same location tar xjf netkitX.Y.tar.bz2tar xjf netkitX.Y.tar.bz2 tar xjf netkitfilesystemFX.Y.tar.bz2 (this may take a while; tar xjf netkitfilesystemFX.Y.tar.bz2 (this may take a while; warning: decompressed size exceeds 600MB)warning: decompressed size exceeds 600MB) tar xjf netkitkernelKX.Y.tar.bz2tar xjf netkitkernelKX.Y.tar.bz2
setting up netkit (2)setting up netkit (2) configure your shell to set the following configure your shell to set the following
environment variablesenvironment variables NETKIT_HOME must be set to the directory containing NETKIT_HOME must be set to the directory containing
the decompressed version of netkitthe decompressed version of netkit “ “$NETKIT_HOME/bin” must be appended to the PATH$NETKIT_HOME/bin” must be appended to the PATH “ “:$NETKIT_HOME/man” must be appended to the :$NETKIT_HOME/man” must be appended to the
MANPATHMANPATH for example (assuming bash is being used)for example (assuming bash is being used)
o export NETKIT_HOME=~/netkit2export NETKIT_HOME=~/netkit2o export PATH=$PATH:$NETKIT_HOME/binexport PATH=$PATH:$NETKIT_HOME/bino export MANPATH=:$NETKIT_HOME/manexport MANPATH=:$NETKIT_HOME/man
setting up netkit (3)setting up netkit (3) you can check your configuration by
entering the netkit directory… cd $NETKIT_HOME
…and running the check_configuration.sh script ./check_configuration.sh
if all the checks succeed, then you are ready to use netkit
netkit vcommandsnetkit vcommands allow to startup virtual machines with
arbitrary configurations (memory, network interfaces, etc.) vstart: starts a new virtual machine vlist: lists currently running virtual machines vconfig: attaches network interfaces to running
vms vhalt: gracefully halts a virtual machine vcrash: causes a virtual machine to crash vclean: “panic command” to clean up all netkit
processes (including vms) and configuration settingson the host machine
netkit lcommandsnetkit lcommands ease setting up complex labs consisting
ofseveral virtual machines lstart: starts a netkit lab lhalt: gracefully halts all vms of a lab lcrash: causes all the vms of a lab to crash lclean: removes temporary files from a lab
directory linfo: provides information about a lab
withoutstarting it ltest: allows to run tests to check that the lab
isworking properly
Build Virtual MachineBuild Virtual Machine
creating a virtual machine 1
user@localhost:~$ vstart pc1 eth0 = A
Nama PC
Tingkatan NIC
Nama Jaringan
View PC1View PC1
View PC1 (2)View PC1 (2)
Halt PC1Halt PC1
Restarting NetworkRestarting Network /etc/rc.d/networking restart/etc/rc.d/networking restartoror service network restartservice network restart
Static Routing
network topologynetwork topologyhigh level viewhigh level view
network topologynetwork topologyconfiguration details (2)configuration details (2)
Grouping the NetworkGrouping the NetworkA > PC1, r1 NID : 195.11.14.0/24A > PC1, r1 NID : 195.11.14.0/24C > PC2, r2 NID : 200.1.1.0/24C > PC2, r2 NID : 200.1.1.0/24B > r1, r2 NID : 100.0.0.8/30B > r1, r2 NID : 100.0.0.8/30
The Command is..The Command is..
The Command is..(2)The Command is..(2)
Testing connectivityTesting connectivity
?Testing connectivity(2)Testing connectivity(2)
interfaces on interfaces on differentdifferentdomains cannot bedomains cannot bereachedreachedcan you tell why?can you tell why?
SolutionSolution to fix the problem we could specify the default route on
thepcs: “through this gateway (ip number) you can reach all theother networks”
Check it.Check it.
Problem! Once again..Problem! Once again..
Solution againSolution again
Final CheckFinal Check
ReferencesReferenceshttp://netkit.org/http://netkit.org/OSC documentation filesOSC documentation files