Computer Network Architectures gsyc-profes@gsyc.escet.urjc.es December 5, 2007
(cc) 2007. Algunos derechos reservados. Este trabajo se entrega bajo la licencia Creative Commons Attribution-ShareAlike. Para obtener la licencia completa, véase http://creativecommons.org/licenses/by-sa/2.1/es. También puede solicitarse a Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
NetGUI NetGUI is a graphic user interface to the Netkit system Functionality Creation/loading of a network diagram by means of a graphic interface by means of selection/dragging of routers, hubs and hosts. Connection of network elements Emulated HW boot-up: hosts and routers may be configured through a Linux shell Management of the network through a Linux shell You may want to install it at home: http://mobiquo.gsyc.es/netgui-v0.4.1b/
NetGUI, Netkit and UML NetGUI: Netkit: Graphic interface to Netkit Software environment that allows to experiment with virtual computer networks without physically having the communication devices Allows to run several virtual nodes (computers, hubs, routers) that emulate the functioning of a GNU/Linux machine Uses UML virtual machines UML (User Mode Linux): Linux kernel that may be run as an own user process in a Linux machine We will call virtual machine (vm) to any of the UML processes that emulate a computer or router.
The graphic interface NetGUI is run by means of the netgui command
The selection tool The selection tool (button with an arrow similar to the mouse cursor) allows following functionality: Move an element: click with the left button of the mouse on an element and drag it to its final location Start/stop node (computer or router): right click on the node. If the node is stopped, it will be started; if it is running, it will be stopped. A running node has two blue arrows on its icon Show the shell of a running node (computer or router): double clik with the left button on the node. A window with a shell will emerge. Zoom: by clicking the right button on the background of the window (given that there is no element there) and moving the mouse right or left we will obtain a zooming effect Move: by clicking the left button on the background of the window (given that there is no element there) and moving the mouse right or left, we will move the focus of the window
The Archivo menu The Archivo menu allows to save the network diagram and to load previously saved diagrams. When saving, you have to choose a folder name. In that folder all the files associated to the diagram will be saved: netgui.nkp: contains information of the picture of the diagram *.disk: contains the file system of the virtual machines with the modifications performed on each VERY IMPORTANT: Save the diagram when you are finished, BEFORE running the virtual machines! NEVER use Guardar como, always Guardar.
Shells NetGUI
Information about network interfaces (I) Information includes addresses, Ethernet, IP, network masks, etc. With ifconfig: eth0 Link encap:ethernet Hwaddr 0A:29:92:55:93:70 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:224 (224.0 b) TX bytes:280 (280.0 b) Interrupt:5 lo Link encap:locap Loopback inet addr:127.0.0.1 Bcast:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:504 (504.0 b) TX bytes:504 (504.0 b)
Information about network interfaces (and II) Information includes addresses, Ethernet, IP, network masks, etc. With ip 0: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo fast qlen 1000 link/ether 0A:29:92:55:93:70 brd ff:ff:ff:ff:ff:ff inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
Adding/removing IP addresses To configure an IP address, following information is required: interface, IP address and mask (or the bits with the prefix of the mask) Add an IP address ifconfig <interface> <IPaddress> netmask <mask> ip address add dev <interface> <IPaddress/maskPrefix> broadcast + Remove an IP address ifconfig <interface> del <IPaddress> ip address del dev <interface> <IPaddress/maskPrefix> After adding/removing an IP address that the configuration is correct (ip or ifconfig)
Routing table The information in the routing table of a machine may be obtained with the route, ip or netstat commands. With route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.0.0 * 255.255.255.0 U 0 0 0 eth0 With ip route show 10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.1 With netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
Adding a route to the routing table With route: Route to a machine route add -host <máquinadestino> gw <gateway> dev <interface> $ route add -host 11.0.0.1 gw 10.0.0.1 dev eth0 Route to a network route add -net <subreddestino> netmask <mask> gw <gateway> dev <interface> $ route add -net 12.0.0.0 netmask 255.255.255.0 gw 10.0.0.1 dev eth0 Route by defect route add default gw <gateway> dev <interface> $ route add default gw 10.0.0.2 dev eth0 With ip: Route to a machine or a subnet: ip route add <IPaddress/mask> via <gateway> dev <interface> $ ip route add 12.0.0.0/24 via 10.0.0.1 dev eth0
Removing a route from the routing table With route: Route to a machine route del -host <máquinadestino> $ route del -host 11.0.0.1 Route to a network route del -net <subreddestino> netmask <mask> $ route del -net 12.0.0.0 netmask 255.255.255.0 Route by defect route del default gw <gateway> dev <interface> $ route del default gw 10.0.0.2 dev eth0 With ip: Route to a machine or a subnet: ip route del <dirp/mask> via <gateway> dev <interface> $ ip route del 12.0.0.0/24 via 10.0.0.1 dev eth0 Route by default: ip route del default via <gateway> dev <interface> $ ip route del default via 10.0.0.2 dev eth0