w.aplikacji w.prezentacji w.sesji w.transportowa w.sieciowa w.łącza w.fizyczna Model ISO - OSI Telnet SMTP FTP DNS NFS XDR RPC TCP UDP IP Ethernet IEEE 802.3 X.25 SLIP PPP A B C D E 0 0.0.0.0 10 128.0.0.0 110 192.0.0.0 1110 224.0.0.0 1111 240.0.0.0 Klasy adresów IP 127.255.255.255 191.255.255.255 223.255.255.255 239.255.255.255 255.255.255.255 1% 3% w.aplikacji w.prezentacji w.sesji w.transportowa w.sieciowa w.łącza w.fizyczna OSI packet encapsulation nagłówek dane końcówka B 255.255.255.192 Subnetting 11 11 11 11 11 11 11 11 11 11 11 11 11 00 00 00 148.81.31.145 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 148.81.31.191 address 10 01 01 00 01 01 00 01 00 01 11 11 10 01 00 01 0.0.0.17 148.81.31.128 netmask host network 10 01 01 00 01 01 00 01 00 01 broadcast 11 11 10 00 00 00 10 01 01 00 01 01 00 01 00 01 11 11 10 11 11 11 2% 4%
TCP/IP Eth. IP TCP data chk Polecenie ifconfig src dst sequence acknowledge source destination ifconfig interface [address family] [address] [up] [down] [netmask mask] [broadcast address] address family rodzina adresów address adres interfejsu up down włączenie/wyłączenie interfejsu netmask maska podsieci broadcast adres broadcastowy destination source type 5% 7% 148.81.31.193 148.81.31.230 R Routers 148.81.31.65 255.255.255.192 148.81.31.72 148.81.31.64... 127 225.225.225.192 148.81.31.192... 225 255.255.255.224 148.81.31.0... 31 148.81.31.30 R A B C 148.81.31.1 148.81.31.2 Polecenie route route [-fn] add delete [host net] destination [gateway[metric] ] -f opróżnij tablice routingu -n wyświetlaj adresy a nie nazwy destination numer maszyny/sieci gateway adres najbliższego routera metric koszt (odległość) 6% 8%
Polecenie netstat Polecenie arp netstat [-rnpsv] -r wyświetl tablicę routingu -n wyświetlaj adresy a nie nazwy -s wyświetl statystyki -v wyświetl obszerniejsze informacje arp [-v] [-d host] [-s host addr] -d skasujpozycję -s utwórz nową pozycję -v wyświetl obszerniejsze informacje 9% 11% Tablica routingu Plik /etc/inetd.conf Routing Table: Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 127.0.0.1 127.0.0.1 UH 0 9790 lo0 148.81.64.64 148.81.63.248 UGH 0 0 148.81.65.64 148.81.63.243 UGH 0 0 148.81.31.0 148.81.63.249 UGH 0 0 148.81.63.32 148.81.63.250 UGH 0 0 148.81.64.96 148.81.63.248 UGH 0 0 148.81.31.224 148.81.63.249 UGH 0 0 148.81.63.224 148.81.63.254 U 3 21336 le0 224.0.0.0 148.81.63.254 U 3 0 le0 default 148.81.63.250 UG 0 39701 service-name endpoint-type protocol wait-status uid server-program server-arguments service-name nazwa usługi (z /etc/services) endpoint-type rodzaj: stream, dgram, raw, tli protocol nazwa protokółu (z /etc/protocols) wait-status nowait/wait czy server zwalnia połączenie uid z jakim UID ma być wykonywany server server-program ścieżka do programu servera server-arguments argumenty wywołania (wraz z argumentem 0) 10% 12%
Plik /etc/services fragment Plik /etc/inetd.conf fragment ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd telnet stream tcp nowait root /usr/sbin/in.telnetd in.telnetd shell stream tcp nowait root /usr/sbin/in.rshd in.rshd login stream tcp nowait root /usr/sbin/in.rlogind in.rlogind exec stream tcp nowait root /usr/sbin/in.rexecd in.rexecd talk dgram udp wait root /usr/sbin/in.talkd in.talkd finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd Network services, Internet style echo 7/tcp echo 7/udp telnet 23/tcp smtp 25/tcp mail whois 43/tcp nicname usually to sri-nic finger 79/tcp UNIX specific services these are NOT officially assigned talk 517/udp 13% 15% Plik /etc/services Plik /etc/protocols service-name port/protocol aliases service-name nazwa usługi port numer portu protocol nazwa protokółu (z /etc/protocols) aliases alternatywne nazwy usługi protocol protocol-number aliases protocol nazwa protokołu protocol-number numer protokołu aliases alternatywne nazwy protokołów 14% 16%
Plik /etc/protocols fragment Internet (IP) protocols ip 0 IP internet protocol, pseudo protocol number icmp 1 ICMP internet control message protocol ggp 3 GGP gateway-gateway protocol tcp 6 TCP transmission control protocol egp 8 EGP exterior gateway protocol pup 12 PUP PARC universal packet protocol udp 17 UDP user datagram protocol hmp 20 HMP host monitoring protocol xns-idp 22 XNS-IDP Xerox NS IDP rdp 27 RDP "reliable datagram" protocol Internet host table 127.0.0.1 localhost loghost 148.81.31.1 csd 148.81.31.2 csd1 148.81.31.3 csd2 148.81.31.4 csd3 Plik /etc/hosts fragment 17% 19% Plik /etc/hosts Plik /etc/networks IP-address official-host-name nicknames... official-network-name network-number aliases IP-address adresip official-host-name oficjalnanazwamaszyny nicknames alternatywne nazwy maszyny official-network-name oficjalnanazwasieci network-number numer IP sieci nicknames alternatywne nazwy sieci 18% 20%
Plik /etc/networks fragment The loopback network is used only for intra-machine communication loopback 127 Internet networks arpanet 10 arpa Historical 21% Plik /etc/netmasks network-number netmask network-number numer IP sieci netmask maska sieci Przykład The netmasks file associates Internet Protocol (IP) address masks with IP network numbers. network-number netmask 148.81.0.0 255.255.255.224 22%