Netstat and networking
I am trying to learn IP addressing, networking etc. and would be grateful if anyone could explain this output of the netstat command to me. the command i used was
What does this information tell you?
the rest is here this
Route Table
Active Connections
Proto Local Address Foreign Address State
TCP m:1461 web5.webmailer.de:80 ESTABLISHED
TCP m:1462 web5.webmailer.de:80 ESTABLISHED
TCP m:1463 web5.webmailer.de:80 ESTABLISHED
TCP m:1507 web5.webmailer.de:80 ESTABLISHED
TCP m:1516 hotmail.se:80 FIN_WAIT_1
Could you suggest any good sites for understanding these kind of things?
The first output is the routing table. The routing table defines how IP packets should be moved around. So, if I want to send a packed to IP xxx.xxx.xxx.xxx, then the OS will check the routing table to find out which device it should send the packet over. (modem, network card, adsl, etc)
The netmask is a bit value against which the destination IP is AND'd and the result is compared with the Network Address.
For example: I want to send a packet to a machine with IP 130.145.187.5.
Second line: (130.145.187.5 && 255.0.0.0 ) != 127.0.0.0
Third line: (130.145.187.5 && 255.255.255.0 ) == 130.145.187.0
So, that packet would be routed through the device with IP 130.145.187.80
The first line with 0.0.0.0 and 0.0.0.0 is usually called the default route. Any packets which don't have matches in the routing table will be sent to the default device.
You can also see that IP 130.145.187.80 has a specific route on line four. 130.145.187.80 & 255.255.255.255 == 130.145.187.80. Any packets sent to 130.145.187.80 will be sent to 127.0.0.1 (which is always the local machine as standard. )
If you wanted to set up a home network with two segments - maybe master house and guest cottage - and you wanted to connect both segments with one machine, you could do this:
information:
house: ip range = 192.168.0.0 - 192.168.0.255
with netmask 255.255.255.0
plugged into eth0 (network card 1)
eth0 has address 192.168.0.1
guest: ip range = 10.0.0.0 - 10.0.0.255
with netmask 255.255.255.0
plugged into eth1 (network card 2)
eth1 has address 10.0.0.1
Just thought i would post this here instead of creating a new thread. but what are the equivalent commands for the Windows "net" (netstat, net send, net view) family of commands etc.
Also what is the equivalen of the 'ipconfig' command on UNIX (HP,Solaris etc) systems?