Top Banner
17

Lab 2 ระบบปฏิบัติการลินุกซ์และคําสั่งเครือข่ายพื้นฐาน

Nov 11, 2015

Download

Documents

Know2Pro

Lab 2 ระบบปฏิบัติการลินุกซ์และคําสั่งเครือข่ายพื้นฐาน
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • :ri'arj:y.fr6'r sor%zoools'46o fttrdrr?r aolu ,{",n.-r.re{. .fufl o ro1fr ZeI

    t. 1uocnhr,,*onuoo6'rrio Server trlu:vrurJfirifinr: unix (Linux) rfioriruurdrflu nt"-"t99

    Gateway ,,u, ,u?uo S"rr", dfi LAN Card 3 Internet fou finr:set roruarfi',rfia. Interface ii t IP Address 10.10.10.65/30 ,duurufi'u fsp ABCb. Interface fi Z Ip Address 2O.20.2O.338Ordorusrofi'u ISP XYZc. Interface d 3 IP Address 30.30.30.112+ rfiorusrofi'u:yuu LAN nre,tuo{nh:d. DNS 10.1.200.1 ,10.2.200.1q

    "

    I ee ' A 's d q s

    I I

    t la vluo { 4 fl :tn{ { fr fl o it R r i tl tJ fl [d u11 r { n r:rSs u er o ln ufr n r : d's uluil r ur o.t rau n r l dt fie. riunr.rrdonsro riu:y:tu eBooks (Ip Address fiurud, u 203.t58.r60.0/22.

    Yr

    202.44.0.01n ) lilrirnr:16orunoruru ISp ABCf.,Junl0,6u u sr o riu:vuu rnru a"oo u'la r" (rp naor".. ffur u dr o 6 | .3z.o.or | | .

    . u no i

    122.0.0.0 I 9 ) l1.r ?1 1 fl 15 rSO rJ eto p't]U ISP AB C9try99

    4sAdlnog. raumrqrfrorueoriu:vuu6u f fi"lr1lry;yuufltiteluluro u) uay b)99

    ssoat14 t$11',rfll 't$OrJflOil]U ISP XYZ

    h. yrnrfi sn:fi fi taunr,rlera,nr',,,,uood, nuo, r t / t9

    0 y er o.r dr rJ'r : n rfi o ru Er o'l:J f,l 6 n ra u m x il u'{olsv

    i. 03fio'!1i'1fl15 Backup Directory letc , home , lvar flog lgra?irtflu Compress frle 6ot4S

    etc.tar.gz , fuii:rx*"{ar,ge , varlog.tar.gz -hlU Directory /Backup ttavrirnr: Backup Ifl- i41 ?UYl 13 [?O1 11:00pm flo.tTRtnou

    9999t***flil 'tgtilA*** fl'lr set tot!outitflufirfio rirnr: reboot tnioltrrutrgq{

    9y9

    0 y 9ro { dlil'r: oli]{]u a 1ililo riril u s'ls

    ols A[2n1dOU 3 S? t i l { [TtJ l6:00 d. l l9:00

    iuii..1(...h.9-t-ryn:a0...... t!^l, a

    n-(ulflnlalles wlfloflU:)

  • 50523206023-4 . 3| 50523206025-9 .3

    Lab 2

    1. 2.

    1. netconfig , ifconfig , netstat , traceroute , route , ping , iptables , service , nslookup netconfig IP ,Netmask Gateway GUI # netconfig

    IP ,Netmask Gateway

  • #service network Restart restart network

    ifconfig Network interface ip server # ifconfig Network Interface

  • # ifconfig eth0 192.168.1.66 Ip Address eth0

    Netstat # netstat -lnt # netstat -lnu

    # netstat -rn Kernel routing table

  • # netstat -rc routing cached table

    # netstat -ac connection

  • # netstat -s packet

    # netstat -i interface

    Traceroute (router)traceroute traceroute #traceroute www.google.com www.google.com

  • route

    - Route Table

    # route Route Table

    # route add -net 202.168.0.0/8 gw 10.1.1.1 IP Gateway route # route del -net 202.168.0.0/8 gw 10.1.1.1 IP Gateway route

  • Ping - ping # ping www.google.com c 3 ping (count) 3

    Iptables (filter)

    Firewall network network network Internet Linux Firewall IPTABLES IPTABLES

    iptables

  • iptables [table] (rule)

    [table] 3 (Filter table) (Nat table) (Mangle table) iptables -t nat

    iptables -A INPUT (INPUT chain)

    (match) (source ip address) 1.2.3.4

    (match) (action) (source ip address) 1.2.3.4 (DROP packet )

    3

    1.Filter Table

    (filter table) 2.20 routing decision

    2.Mangle Table TOS, TTL, MARK packet filtering DNAT, SNAT Masquerading

    3.Nat Table (network address translation) (source ip address, destination ip address)

  • packet filtering

    #iptables L ( built-in chain)

    -A (chain) (Append rule) # iptables -A INPUT -p ALL -i eth0 -j ACCEPT

    service (service) start stop restart #service [service name] start/stop/restart #service network restart

  • service #service status-all

    nslookup (coommand) Command prompt Dos DNS DNS (resolve )

  • ARP / arp table (Address Result Protocol) IP Physical Address #arp a

    2. config config IP Address ,Hostname ,Security Hostname - #hostname hostname - #vi /etc/sysconfig/network HOSTNAME= HOSTNAME=TEST555 save wq - Restart 1 - login #hostname hostname

    /etc/resolv.conf /etc/resolv.conf configuration name resolver format text keyword keyword 3 : domain keyword local domain name search keyword host nameswrver keyword IP address name server

  • IP nameserver

    /etc/host.conf /etc/host.conf IP

    name resolver /etc/hosts IP address host /etc/hosts nameserver

    /etc/hosts IP address lan domain name server IP address update IP address IP loopback interface local hosts

    207.48.64.90 sra1.sra.cat.or.th sra1 ( local network)

  • /etc/securetty /etc/securetty root tty devices /etc/securetty login ( /bin/login) list tty devices root

  • 1.

    #service status-all service

    2. Network Address 10.1.5.0/10 Subnet subnet /10 = 11111111.11000000.0000000.0000000 = 255.192.0.0 22-2 = 2 Subnet Host Subnet subnet = 11111111.11000000.0000000.0000000 24-2 = 22 Host Subnet 222- 2 = 4,194,302 Host Subnet 00001010.01000000.00000000.00000000 => 10.64.0.0 00001010.10000000.00000000.00000000 => 10.128.0.0

  • 10.64.0.0 => 10.64.0.1 to 10.127.255.254 10.128.0.0 => 10.128.0.1 to 10.191.255.254