ลีนุกซ์ (Linux)
Home  Contents KMArticlesMembersSponsorsAbout us

ปรับปรุง : 2556-10-06 (ปรับเป็นรุ่น 3)
ขอบซ้ายขอบบน
Linux : 0912
:: กลับหน้าแรก :: แสดงเนื้อหาทั้งหมด ::

9.12 ตัวอย่าง router configuration และการ block port
: config ของ router ทำโดยผู้ดูแลเท่านั้น และมักทำไม่บ่อย บางคน config ครั้งเดียวจบครับ
    เคยมีอาจารย์บางโรงเรียนที่เปิดบริการอินเทอร์เน็ต แล้วยอมให้นักเรียนเล็ก ๆ ของพวกเขาเล่นเกม online ได้ แต่ firewall ปิดการเล่นเกม online ไว้ ทำให้เล่นกันไม่ได้เลย ผมก็เลยหาจากเว็บว่า ragnarok ใช้ port อะไร จะได้เปิดให้นักเรียนได้เล่น เรื่องห้าม ไม่ห้ามเล่น block หรือ ไม่ block ragnarok หรือเกมอื่น ๆ กำลังเป็นที่ถกเถียงกัน เพียงแต่ port ที่ ragnarok เข้าใช้คือ 5000 และ 6900 ซึ่งอ่านได้จาก http://www.ragnarok.in.th/faq_n.html
    # show ip interface brief ใช้แสดงสถานะ FastEthernet ซึ่งเป็นฝั่ง LAN และ Serial0/0 ซึ่งเป็นฝั่ง WAN
    ตัวอย่างการ config router
    c:\telnet router.yonok.ac.th
    username : superman
    password : supergirl
    yonok-router>help
    yonok-router>enable
    Password:
    yonok-router#?
    yonok-router#config terminal
    yonok-router(config)#
    . . . . . . .
    yonok-router(config)#interface Serial0/0
    yonok-router(config)#ip access-group 101 out
    yonok-router(config)#access-list 101 deny tcp host 202.29.78.9 any eq 5000
    yonok-router(config)#access-list 101 deny tcp host 202.29.78.9 any eq 6900
    yonok-router(config)#access-list 101 permit ip any any
    . . . . . . .
    type command by your self
    type no in the front of the command if you want to delete 
    webguide: http://www.cisco.com/en/US/products/hw/switches/ps718/products_command_reference_chapter09186a00800ed9dc.html
    . . . . . . .
    . . . . . . .
    yonok-router(config)#
    yonok-router(config)#exit
    yonok-router#write
    yonok-router#reload
    
    yonok-router#show run Building configuration... Current configuration : 1905 bytes ! version 12.2 service timestamps debug uptime service timestamps log uptime service password-encryption service udp-small-servers service tcp-small-servers ! hostname yonok-router ! aaa new-model ! aaa session-id common enable secret 5 aaaaQT$u.xb5Wxpxk5aaaaaaa enable password 7 aaaa3080aaa ! username superman password 7 aaaa81F1C354aaa ip subnet-zero ! interface FastEthernet0/0 ip address 202.29.78.254 255.255.255.0 speed auto full-duplex no cdp enable ! interface Serial0/0 ip address 202.28.202.74 255.255.255.252 ip access-group 102 in ip access-group 101 out no cdp enable ! router igrp 1 redistribute connected network 202.28.29.0 network 202.29.78.0 ! ip classless ip route 0.0.0.0 0.0.0.0 Serial0/0 ip route 0.0.0.0 0.0.0.0 202.28.29.41 no ip http server ip pim bidir-enable ! access-list 101 deny tcp host 202.29.78.13 any eq ftp access-list 101 deny tcp host 202.29.78.13 any gt 6000 access-list 101 permit ip any any access-list 102 deny tcp any 202.29.78.0 0.0.0.255 eq 135 access-list 102 deny udp any 202.29.78.0 0.0.0.255 eq 135 access-list 102 permit ip any any access-list 103 deny tcp host 202.29.78.18 any eq ftp access-list 103 deny tcp host 202.29.78.18 any gt 2000 access-list 103 permit ip any any dialer-list 1 protocol ip permit dialer-list 1 protocol ipx permit no cdp run snmp-server community public RO banner login ^CC ********************************************************************** * www.yonok.ac.th * ********************************************************************** ^C ! line con 0 line aux 0 line vty 0 4 password 7 aaa385F5A0aaa ! end yonok-router#

    แสดงสถานะการเชื่อมต่อกับอุปกรณ์นอกสถาบันว่า Serial กับ Protocol ปกติหรือไม่ ถ้า Protocol ไม่ up ก็จะ ping ไม่ได้ แต่ถ้า Serial ขึ้น แสดงว่าเชื่อมต่อกับ TOT ได้ yonok-router#show ip interface brief yonok-router#show interface serial0/0 Serial0/0 is up, line protocol is up Hardware is PowerQUICC Serial Internet address is 202.28.202.74/30 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, reliability 255/255, txload 33/255, rxload 37/255 Encapsulation HDLC, loopback not set Keepalive set (10 sec) Last input 00:00:01, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fair Output queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/12/256 (active/max active/max total) Reserved Conversations 0/0 (allocated/max allocated) Available Bandwidth 1158 kilobits/sec 5 minute input rate 227000 bits/sec, 46 packets/sec 5 minute output rate 203000 bits/sec, 67 packets/sec 25507 packets input, 15405951 bytes, 0 no buffer Received 136 broadcasts, 0 runts, 6 giants, 0 throttles 158 input errors, 40 CRC, 102 frame, 0 overrun, 0 ignored, 16 abort 41777 packets output, 13772824 bytes, 0 underruns 0 output errors, 0 collisions, 21 interface resets 0 output buffer failures, 0 output buffers swapped out 2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up yonok-router#

ขอบซ้ายขอบบน
สารบัญ
กรณีศึกษาจาก Redhat 6.2 -> Fedora Core 4 -> Android 4.01
บทที่ 1 : คำสั่งสำหรับผู้ใช้พื้นฐาน (Basic user command)
    1.1 คำสั่ง ls : แสดงรายชื่อแฟ้มในห้องปัจจุบัน หรือห้องอื่น ๆ ที่ต้องการ 1.2 คำสั่ง chmod : เปลี่ยนสถานะของแฟ้มเช่น Read Write eXecute 1.3 คำสั่ง man : แสดงรายละเอียดของคำสั่ง (Manual) 1.4 คำสั่ง mkdir, rmdir, cd : คำสั่งเกี่ยวกับ Directory หรือ Folder เพื่อสร้าง หรือลบ 1.5 คำสั่ง pico : editor ยอดฮิตใน Linux ที่ต้องมากับ Pine เป็น Text mode ที่ใช้ง่ายที่สุด 1.6 คำสั่ง emacs : editor ยอดฮิตใน Linux ใช้ยากกว่า pico นิดหน่อย 1.7 คำสั่ง vi : editor ยอดฮิตใน Linux ที่ใช้ยากที่สุด 1.8 คำสั่ง id, finger, who, w : โปรแกรมตรวจสอบ username ของตนเอง 1.9 คำสั่ง cat : แสดงข้อมูลในแฟ้มเหมือนคำสั่ง type ในระบบ DOS 1.10 คำสั่ง ifconfig : ดู IP หรือเพิ่ม IP เข้าไปใน linux server 1.11 คำสั่ง netstat : แสดงสถานะของเครือข่าย 1.12 คำสั่ง service : แสดงสถานะโปรแกรมที่เปิดให้บริการ 1.13 คำสั่ง xinetd : แสดงบริการที่เปิดใต้โปรแกรม xinetd 1.14 คำสั่ง whereis : ค้นหาแฟ้มที่ต้องการว่าอยู่ที่ห้องใด 1.15 คำสั่ง cp, rm, mv : จัดการแฟ้มเช่น คัดลอก ลบ และย้าย 1.16 คำสั่ง ping : ตรวจสอบ ip และการเชื่อมต่อ internet 1.17 คำสั่ง env : แสดงค่า environment ปัจจุบัน 1.18 คำสั่ง lynx : Text browser ที่ใช้งานง่าย ใช้ดู source หรือ download ได้ 1.19 คำสั่ง nslookup : แสดงข้อมูลเกี่ยวกับ name server จาก ip หรือ domain name 1.20 คำสั่ง tail : แสดงส่วนท้ายของแฟ้มที่มีขนาดใหญ่ ต้องข้ามกับ cat ที่ดูตั้งแต่เริ่มแฟ้ม 1.21 คำสั่ง telnet : ใช้ติดต่อเข้า server ต่าง ๆ ตาม port ที่ต้องการ .
บทที่ 2 : คำสั่งสำหรับผู้ใช้ระดับกลาง (Intermediate user command) เพื่อต้องการตรวจสอบระบบ
    2.1 คำสั่ง df : แสดง partition ของ linux พร้อมขนาดที่ใช้ไป 2.2 คำสั่ง du : แสดงพื้นที่ใช้งานในแต่ละ Directory 2.3 คำสั่ง ps : แสดง process ที่กำลังทำงานอยู่ทั้งของเครื่อง และตนเอง 2.4 คำสั่ง kill : ยกเลิก process ที่ทำงานอยู่ 2.5 คำสั่ง find : ค้นหาแฟ้มที่ต้องการภายในทุก ๆ directory ได้ 2.6 คำสั่ง gzip : คลายการบีบอัด หรือแตกแฟ้มประเภท .gz 2.7 คำสั่ง tar : คลายการบีบอัด หรือแตกแฟ้มประเภท .tar 2.8 คำสั่ง last : แสดงรายชื่อผู้ใช้งานระบบปัจจุบันไปถึงอดีต 2.9 คำสั่ง grep : เลือกข้อความที่ต้องการภายในแต่ละบรรทัด 2.10 คำสั่ง date, hwclock : ใช้กำหนด หรือแสดงเวลาปัจจุบัน 2.11 คำสั่ง top : แสดง process ที่ทำงานในปัจจุบัน พร้อม refresh ตลอดเวลา 2.12 คำสั่ง ntsysv และ setup : กำหนดบริการที่ต้องการเปิด หรือปิด เช่น httpd หรือ vsftp 2.13 คำสั่ง route : ใช้กำหนด แสดง ตารางเส้นทาง 2.14 คำสั่ง shutdown, reboot : ใช้ปิดเครื่อง หรือ ปิดและเปิดเครื่องใหม่อย่างถูกวิธี 2.15 คำสั่ง runlevel : คู่กับแฟ้ม /etc/inittab 2.16 คำสั่ง fsck : ซ่อมแซมระบบแฟ้มใน linux 2.17 คำสั่ง chown, chgrp : เปลี่ยนเจ้าของ หรือเปลี่ยนกลุ่ม 2.18 คำสั่ง chkconfig : กำหนด หรือแสดง บริการที่สั่งประมวลผลใน level ต่าง ๆ ขณะเปิดเครื่อง 2.19 คำสั่ง mount, umount : เชื่อมต่ออุปกรณ์ หรือ partition เช่น Diskette หรือ Handy drive 2.20 คำสั่ง mkbootdisk : สร้างแผ่น boot disk เพื่อใช้ boot ระบบ linux ขึ้นมาภายหลัง 2.21 คำสั่ง traceroute : แสดงเลข ip ของเครื่องที่ถูกเชื่อมต่อ ไปยังปลายทางที่ต้องการ 2.22 คำสั่ง rpm : ใช้ตรวจสอบ เพิ่ม หรือลบ package ของระบบ linux เกือบทั้งหมด 2.23 คำสั่ง su : ขอเปลี่ยนตนเองเป็น Super user เพื่อใช้สิทธิสูงสุดในการบริหารระบบ 2.24 คำสั่ง useradd : เพิ่มผู้ใช้รายใหม่เข้าไปในระบบ 2.25 คำสั่ง userdel : ลบผู้ใช้รายเดิม ออกจากระบบ 2.26 คำสั่ง usermod : แก้ไขข้อมูลของผู้ใช้ได้ 2.27 คำสั่ง crontab : ตั้งเวลาสั่งงานคอมพิวเตอร์ 2.28 คำสั่ง lspci : ตรวจสอบอุปกรณ์ที่เชื่อมต่อภายในเครื่อง 2.29 คำสั่ง nmap : ตรวจสอบเครือข่ายแบบกวาดทั้งในเครื่อง และ class C .
บทที่ 3 : บทเรียน PERL บทที่ 4 : บทเรียน PHP บทที่ 5 : บทเรียน MYSQL บทที่ 6 : แนะนำเครื่องบริการ บทที่ 7 : การใช้ application บทที่ 8 : ระบบ file และ directory บทที่ 9 : การบริหารระบบ โดย Super User
ผู้สนับสนุน + ผู้สนับสนุน
+ รับผู้สนับสนุน
"Imagination is more important than knowledge" - Albert Einstein
Home
Thaiabc.com
Thainame.net
Lampang.net
Nation university
PHP
MySQL
Visual basic.NET
TabletPC
Linux
Online quiz
Download
Search engine
Web ranking
Add website
Blog : Education
Blog : ACLA
Blog : Lampang
Facebook.com
Twitter.com
About us
My dream
Site map
Sponsor