|
Eng | Rus
Virtual terminal and comand line interface.NET-Simulator allows the users to control the virtual devices by means of virtual terminals and command line interface. 'Double click' on the device icon to open the terminal window. Use up/down keys to navigate the commands history. Type help and press Enter to see a list of all available commands. Use -h option with any of the commands to get a reference guide. Use Ctrl+L to refresh the screen. Command reference:helproute ifconfig ping arp mactable help - display reference guide and exit. help [-h]
route manipulates the IP4 routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured using the ifconfig program. route [-h] [{-add|-del} <target> [-netmask <address>] [-gw <address>] [-metric <M>] [-dev <If>]]
When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables: =>route
IP routing table
Destination Gateway Netmask Flags Metric Iface
10.0.0.0 * 255.0.0.0 U 1 eth0
11.0.0.0 10.0.0.10 255.0.0.0 UG 1 eth0
192.168.120.1 10.0.0.10 255.255.255.255 UGH 1 eth0
If the gateway is not set * is pitnted. Flags possible values include: U - route is up, G - use gateway, H - target is a host. Examples: =>route -add 192.168.120.0 -netmask 255.255.255.0 -dev eth0
=>route
IP routing table
Destination Gateway Netmask Flags Metric Iface
192.168.120.0 * 255.255.255.0 U 1 eth0
=>
=>route -add 192.168.121.10 -gw 192.168.120.10
=>route
IP routing table
Destination Gateway Netmask Flags Metric Iface
192.168.120.0 * 255.255.255.0 U 1 eth0
192.168.121.10 192.168.120.1 255.255.255.255 UGH 1 eth0
=>
ifconfig - configure a network interface. ifconfig [-h] [-a] [<interface>] [<address>] [-broadcast <address>] [-netmask <address>] [-up|-down]
Without options ifconfig displays all active interfaces: =>ifconfig
eth0 Link encap:Ethernet HWaddr 0:0:0:0:CF:0
inet addr:192.168.120.1 Bcast:192.168.120.255 Mask:255.255.255.0
UP
RX packets:23 errors:0 dropped:0
TX packets:23 errors:0 dropped:0
RX bytes:0 TX bytes:0
HWaddr - 6 bytes unique address of the interface by analogy to MAC address in Ethernet. It is generated automatically. Examples: =>ifconfig eth0 192.168.120.1 -up
=>ifconfig
eth0 Link encap:Ethernet HWaddr 0:0:0:0:CF:0
inet addr:192.168.120.1 Bcast:192.168.120.255 Mask:255.255.255.0
UP
RX packets:0 errors:0 dropped:0
TX packets:0 errors:0 dropped:0
RX bytes:0 TX bytes:0
ping uses ICMP protocol in order to check the accessibility of the target interface. ping sends ICMP ECHO_REQUEST to the target interface and waits during some period of time (one second by default) for ICMP ECHO_RESPONSE. In case if the response is received displays gathered data. ping [-h] [-i <interval>] [-t <ttl>] <destination>
Examples: =>ping 192.168.120.1
PING 192.168.120.1
64 bytes from 192.168.120.1: icmp_seq=0 ttl=62 time=477 ms
64 bytes from 192.168.120.1: icmp_seq=1 ttl=62 time=435 ms
64 bytes from 192.168.120.1: icmp_seq=2 ttl=62 time=234 ms
64 bytes from 192.168.120.1: icmp_seq=3 ttl=62 time=48 ms
64 bytes from 192.168.120.1: icmp_seq=4 ttl=62 time=87 ms
64 bytes from 192.168.120.1: icmp_seq=5 ttl=62 time=56 ms
ping displays the output in the following format: 64 bytes from 192.168.120.1 - the size of data received in the response and the address of the target host. The size is always 64B. icmp_seq=0 - the number of the packet in the sequence. ttl=62 - TTL value from the received packet. time=48 ms - round-trip time in milliseconds. arp - displays the ARP-table. In addition there is NET-Simulator specific option -r that allows sending the special request in order to resolve the MAC-address for the specified IP-address. This option does not make sense in the real world but in the simulator can be useful for the ARP-protocol understanding. arp [-h] [-r <IP-address> <interface>]
Without options displays ARP-table: =>arp
Address HWaddress iface
10.0.0.10 0:0:0:0:BC:0 eth0
10.0.0.11 0:0:0:0:1F:2 eth0
Examples: =>arp -r 192.168.120.12 eth1
Address HWaddress iface
10.0.0.10 0:0:0:0:BC:0 eth0
10.0.0.11 0:0:0:0:1F:2 eth0
192.168.120.12 0:0:0:0:12:1 eth1
mactable - displays the MAC-address table. This is NET-Simulator specific option. mactable [-h]
Examples: =>mactable
MACAddress port
0:0:0:0:B3:0 0
0:0:0:0:2F:2 0
0:0:0:0:03:0 3
port - the number of the port. |
|
Last update: 06.04.2010 23:06. Email: maxim-tereshin@yandex.ru |