Prelab 2

Prelab #2 Solutions:

#1

Write the syntax for an ifconfig command that sets the IP address of the interface eth0 to 128.143.2.3/16 with broadcast address 128.143.255.255.

ifconfig eth0 128.143.2.3 netmask 255.255.0.0 broadcast 128.143.255.255
#2

Write the syntax of a tcpdump command that captures packets containing IP datagrams with a source or destination IP address equal to 10.0.1.12.

tcpdump host 10.0.1.12
#3

Write the syntax of a tcpdump command that captures packets containing ICMP messages with a source or destination IP address equal to 10.0.1.12.

tcpdump icmp and host 10.0.1.12
#4

Write the syntax of a tcpdump command that captures packets containing IP datagrams between two hosts with IP addresses 10.0.1.11 and 10.0.1.12, both on interface eth1.

tcpdump -i eth1 host 10.0.1.11 and host 10.0.1.12
#5

Write a tcpdump filter expression that captures packets containing TCP segments with a source or destination IP address equal to 10.0.1.12.

tcp and host 10.0.1.12
#6

Write a tcpdump filter expression that, in addition to the constraints in Question 5, only captures packets using port number 23.

tcp port 23 and host 10.0.1.12
#7

Write the syntax for an ethereal command with capture filter so that all IP datagrams with a source or destination IP address equal to 10.0.1.12 are recorded.

ethereal -f host 10.0.1.12
#8

Write the syntax for an ethereal display filter that shows IP datagrams with a destination IP address equal to 10.0.1.50 and frame sizes greater than 400 bytes.

ip.dst == 10.0.1.50 && frame.pkt_len > 400
#9

Write the syntax for an ethereal display filter that shows packets containing ICMP messages with a source or destination IP address equal to 10.0.1.12 and frame numbers between 15 and 30.

ip.addr == 10.0.1.12 && icmp && frame.number > 15 && frame.number < 30
#10

Write the syntax for an ethereal display filter that shows packets containing TCP segments with a source or destination IP address equal to 10.0.1.12 and using port number 23.

ip.addr == 10.0.1.12 && tcp.port == 23
#11

Write an ethereal capture filter expression for Question 10.

host 10.0.1.12 and tcp port 23