Total Tayangan Halaman

Sabtu, 28 Mei 2011

Cara Membuat Anti Virus Sederhana

Cara Membuat Anti Virus Sendiri

Pertama kita harus mengerti bagaimana cara kerja
sebuah AV sederhana, pada dasarnya sebuah software AV mempunyai
komponen-komponen :

1. Engine scanner, ini merupakan komponen utama AV
dalam mengenali sebuah pattern virus. Engine ini dapat dikelompokkan
menjadi statis dan dinamis. Statis dalam hal ini dapat disebut menjadi
spesifik terhadap pattern tertentu dari sebuah file virus. Checksum
merupakan salah satu contoh dari engine statis ini. Dinamis dalam
artian dia mengenali perilaku ‘umum’ sebuah virus. Heuristic menjadi
salah satu contohnya.

2. Database definition, menjadi sebuah referensi dari sebuah pattern
file virus. Engine statis sangat bergantung kepada komponen ini.

3. Decompress atau unpacking engine, khusus untuk pengecekan file-file
yang terkompresi (*.rar, *.zip, dll) atau kompresi atau packing untuk
file PE seperti UPX, MeW , dll.

Tidak jarang hasil dari pengecekan terhadap file
suspect virus menghasilkan false-positive bahkan false-negative (–
false-positive berarti file yang bersih dianggap thread oleh AV, dan
false-negative berarti file yang 100% thread akan dianggap bersih).
Semua itu dapat diakibatkan oleh ketidak-sempurnaan dari engine scanner
itu sendiri. Misal

pada contoh kasus Engine String scanner (–Engine scanner yang
menyeleksi string-string dari file text-based), bila diterapkan rule 3
out of 5 (– bila AV menemukan 3 dari daftar 5 string kategori
malicious) maka AV akan memberikan bahwa file terindikasi sebuah thread
yang positif. Padahal file tsb nyatanya tidak menimbulkan efek
berbahaya bila dijalankan atau dieksekusi. Kesalahan scanning macam ini
lazim ditemukan untuk file-file *.VBS, *.HTML, dll. Untuk penggunaan
engine checksum sangat banyak ditemui di beberapa software AV lokal.
Checksum yang lazim digunakan diantaranya CRC16, CRC32, MD5, dll.
Dikarenakan mudah untuk diimplementasikan. Engine ini sendiri bukannya
tanpa cacat, Checksum bekerja dengan memproses byte demi byte dari
sebuah file dengan sebuah algoritma tertenu (– tergantung dari jenis
checksum yang digunakan) sehingga menghasilkan sebuah format tertentu
dari file tsb. Contoh checksum menggunakan CRC32 dan MD5 :

* calCrc = CRC32(file_name_and_path)

* calMD5 = MD5(file_name_and_path)

Maka isi dari string calCrc adalah 7AF9E376,
sedangkan untuk MD5nya adalah 529CA8050A00180790CF88B63468826A. Perlu
diketahui bila virus menerapkan rutin yang mengubah byte tertentu dari
badan virus tsb setiap kali maka penggunaan engine checksum ini akan
kurang optimal karena bila 1 byte berubah dari file maka checksum juga
akan berubah.

Mari kita belajar membuat sebuah AV sederhana, yang diperlukan :

1. Software Visual Basic 6.0

2. Sedikit pemahaman akan pemograman Visual Basic 6.0

3. Sampel file bersih atau virus (– opsional)

First#

Sekarang kita akan belajar membuat sebuah rutin sederhana untuk :

- Memilih file yang akan dicek

- Membuka file tersebut dalam mode binary

- Memproses byte demi byte untuk menghasilkan Checksum

Buka MS-Visual Basic 6.0 anda, lalu buatlah sebuah
class module dan Form dengan menambahkan sebuah objek Textbox,
CommonDialog dan Command Button. (Objek CommonDialog dapat ditambahkan
dengan memilih Project -> COmponent atau Ctrl-T dan memilih
Microsoft Common Dialog Control 6.0) Ketikkan kode berikut pada class
module (kita beri nama class module tsb clsCrc) :

================= START HERE ====================

Private crcTable(0 To 255) As Long ‘crc32

Public Function CRC32(ByRef bArrayIn() As Byte, ByVal lLen As Long, Optional ByVal lcrc As Long = 0) As Long

‘bArrayIn adalah array byte dari file yang dibaca, lLen adalah ukuran atau size file

Dim lCurPos As Long ‘Current position untuk iterasi proses array bArrayIn

Dim lTemp As Long ‘variabel temp hasil perhitungan

If lLen = 0 Then Exit Function ‘keluar fungsi apabila ukuran file = 0

lTemp = lcrc Xor &HFFFFFFFF

For lCurPos = 0 To lLen

lTemp = (((lTemp And &HFFFFFF00) \\ &H100) And &HFFFFFF) Xor (crcTable((lTemp And 255) Xor bArrayIn(lCurPos)))

Next lCurPos

CRC32 = lTemp Xor &HFFFFFFFF

End Function

Private Function BuildTable() As Boolean

Dim i As Long, x As Long, crc As Long

Const Limit = &HEDB88320

For i = 0 To 255

crc = i

For x = 0 To 7

If crc And 1 Then

crc = (((crc And &HFFFFFFFE) \\ 2) And &H7FFFFFFF) Xor Limit

Else

crc = ((crc And &HFFFFFFFE) \\ 2) And &H7FFFFFFF

End If

Next x

crcTable(i) = crc

Next i

End Function

Private Sub Class_Initialize()

BuildTable

End Sub

================= END HERE ====================

Lalu ketikkan kode berikut dalam event Command1_Click :

================= START HERE ====================

Dim namaFileBuka As String, HasilCrc As String

Dim CCrc As New clsCrc ‘bikin objek baru dari class ClsCrc

Dim calCrc As Long

Dim tmp() As Byte ‘array buat file yang dibaca

Private Sub Command1_Click()

CommonDialog1.CancelError = True ‘error bila user mengklik cancel pada CommonDialog

CommonDialog1.DialogTitle = “Baca File” ‘Caption commondialog

On Error GoTo erorhandle ‘label error handle

CommonDialog1.ShowOpen

namafilbuka = CommonDialog1.FileName

Open namafilbuka For Binary Access Read As #1 ‘buka file yang dipilih dengan akses baca pada mode binary

ReDim tmp(LOF(1) – 1) As Byte ‘deklarasi ulang untuk array, # Bugs Fixed #

Get #1, , tmp()

Close #1

calCrc = UBound(tmp) ‘mengambil ukuran file dari array

calCrc = CCrc.CRC32(tmp, calCrc) ‘hitung CRC

HasilCrc = Hex(calCrc) ‘diubah ke format hexadesimal, karena hasil perhitungan dari class CRC masih berupa numeric

Text1.Text = HasilCrc ‘tampilkan hasilnya

Exit Sub

erorhandle:

If Err.Number <> 32755 Then MsgBox Err.Description ‘error number
32755 dalah bila user mengklik tombol cancel pada saat memilih file

================= END HERE ====================

COba anda jalankan program diatas dengan memencet
tombol F5, lalu klik Command1 untuk memilih dan membuka file. Maka
program akan menampilkan CRC32nya.

Second#

Kode diatas dapat kita buat menjadi sebuah rutin pengecekan file
suspect virus dengan antara membandingkan hasil CRC32nya dan database
CRC kita sendiri. Algoritmanya adalah :

- Memilih file yang akan dicek

- Membuka file tersebut dalam mode binary

- Memproses byte demi byte untuk menghasilkan Checksum

- Buka file database

- Ambil isi file baris demi baris

- Samakan Checksum hasil perhitungan dengan checksum dari file

Format file database dapat kita tentukan sendiri, misal :

- FluBurung.A=ABCDEFGH

- Diary.A=12345678

Dimana FluBurung.A adalah nama virus dan ABCDEFGH dalah Crc32nya. Jika
kita mempunyai format file seperti diatas, maka kita perlu membaca file
secara sekuensial per baris serta memisahkan antara nama virus dan
Crc32nya. Dalam hal ini yang menjadi pemisah adalah karakter ‘=’.

Buat 1 module baru (– diberi nama module1) lalu isi dengan kode :

================= START HERE ====================

Public namaVirus As String, CrcVirus As String
‘deklarasi variabel global untuk nama dan CRC virus Public pathExe as
String ‘deklarasi variabel penyimpan lokasi file EXE AV kita

Public Function cariDatabase(Crc As String, namaFileDB As String) As Boolean

Dim lineStr As String, tmp() As String ‘variabel penampung untuk isi file

Open namaFileDB For Input As #1 ‘buka file dengan mode input

Do

Line Input #1, lineStr

tmp = Split(lineStr, “=”) ‘pisahkan isi file bedasarkan pemisah karakter ‘=’

namaVirus = tmp(0) ‘masukkan namavirus ke variabel dari array

CrcVirus = tmp(1) ‘masukkan Crcvirus ke variabel dari array

If CrcVirus = Crc Then ‘bila CRC perhitungan cocok/match dengan database

cariDatabase = True ‘kembalikan nilai TRUE

Exit Do ‘keluar dari perulangan

End If

Loop Until EOF(1)

Close #1

End Function

================= END HERE ====================

Lalu tambahkan 1 objek baru kedalam Form, yaitu
Command button2. lalu ketikkan listing kode berikut kedalam event
Command2_Click :

================= START HERE ====================

If Len(App.Path) <= 3 Then ‘bila direktori kita adalah root direktori

pathEXE = App.Path

Else

pathEXE = App.Path & “\\”

End If

CommonDialog1.CancelError = True ‘error bila user mengklik cancel pada CommonDialog

CommonDialog1.DialogTitle = “Baca File” ‘Caption commondialog

On Error GoTo erorhandle ‘label error handle

CommonDialog1.ShowOpen

namafilbuka = CommonDialog1.FileName

Open namafilbuka For Binary Access Read As #1 ‘buka file yang dipilih dengan akses baca pada mode binary

ReDim tmp(LOF(1) – 1) As Byte ‘deklarasi ulang untuk array # Bugs Fixed #

Get #1, , tmp()

Close #1

calCrc = UBound(tmp) ‘mengambil ukuran file dari array

calCrc = CCrc.CRC32(tmp, calCrc) ‘hitung CRC

HasilCrc = Hex(calCrc) ‘diubah ke format hexadesimal, karena hasil perhitungan dari class CRC masih berupa numeric

If cariDatabase(HasilCrc, pathEXE & “DB.txt”) Then ‘bila fungsi bernilai TRUE

MsgBox “Virus ditemukan : ” & namaVirus ‘tampilkan message Box

End If

Exit Sub

erorhandle:

If Err.Number <> 32755 Then MsgBox Err.Description ‘error number
32755 dalah bila user mengklik tombol cancel pada saat memilih file

================= END HERE ====================

Fitur AV sederhana ini dapat ditambahkan dengan
fitur process scanner, akses registry, real-time protection (RTP) dan
lain lain. Untuk process scanner pada dasarnya adalah teknik enumerasi
seluruh proses yang sedang berjalan pada Sistem Operasi, lalu mencari
letak atau lokasi file dan melakukan proses scanning.

Sumber : http://orispyro.wordpress.com/

Jumat, 27 Mei 2011

Soal Subnetting


1. A company has the following addressing scheme requirements:
-currently has 25 subnets
-uses a Class B IP address
-has a maximum of 300 computers on any network segment
-needs to leave the fewest unused addresses in each subnet
What subnet mask is appropriate to use in this company?

a. 255.255.240.0
b. 255.255.248.0
c. 255.255.254.0
d. 255.255.255.0
e. 255.255.255.128
f. 255.255.255.248

Jawaban: B

default subnet mask class B 11111111.11111111.0000000.00000000 karena yang diminta 25
subnet, dan yang mendekati adalah 25 maka :

11111111.11111111.11111000.00000000 dan subnet masknya
255 . 255 . 248 . 0

2. Refer to the exhibit. Host A is being manually configured for connectivity to the LAN.
Which two addressing scheme combinations are possible configurations that can be applied
to the host for connectivity? (Choose two.)



a. Address - 192.168.1.14
Gateway - 192.168.1.33
b. Address - 192.168.1.45
Gateway - 192.168.1.33
c. Address - 192.168.1.32
Gateway - 192.168.1.33
d. Address - 192.168.1.82
Gateway - 192.168.1.65
e. Address - 192.168.1.63
Gateway - 192.168.1.65
f. Address - 192.168.1.70
Gateway - 192.168.1.65

Jawaban: D & F

/27 = 11111111.11111111.11111111.11100000
255 . 255 . 255 . 224
subnet masknya adalah : 255.255.255.224
Blok subnetnya = 256 – 224 = 32
Net ID Range Broadcast
192.168.1.0 192.168.1.1 – 192.168.1.30 192.168.1.31
…………… …………………………… ……………
192.169.1.64 192.168.1.65-192.168.1.94 192.168.1.95



3. A NIC of a computer has been assigned an IP address of 172.31.192.166 with a mask of
255.255.255.248. To which subnet does the IP address belong?
a. 172.31.0.0
b. 172.31.160.0
c. 172.31.192.0
d. 172.31.248.0
e. 172.31.192.160
f. 172.31.192.248

Jawaban: E
IP : 172.31.192.166
Netmask : 255.255.255.248
Subnet untuk IP tersebut ?
Jawab :
Block subnet = 256 – 248 = 8
Maka, 172.31.192.8
172.31.192.16
172.31.192.24
172.31.192.32
----------------
172.31.192.160
------------------

4. Which subnet masks would be valid for a subnetted Class B address? (Choose two.)
a. 255.0.0.0
b. 255.254.0.0
c. 255.224.0.0
d. 255.255.0.0
e. 255.255.252.0
f. 255.255.255.192

Jawaban: D & E

Karena untuk subnetmask default untuk class B adalah 255.255.0.0 dan kombinasi dari 2 oktet selanjutnya.

5. Which combination of network id and subnet mask correctly identifies all IP addresses
from 172.16.128.0 through 172.16.159.255?
a. 172.16.128.0 and 255.255.255.224
b. 172.16.128.0 and 255.255.0.0
c. 172.16.128.0 and 255.255.192.0
d. 172.16.128.0 and 255.255.224.0
e. 172.16.128.0 and 255.255.255.192

Jawaban: D

jumlah host dari 172.16.128.1 to 172.16.159.254 adalah 8190 host
2n - 2 = yang hasilnya mendekati 8190 adalah 213 = 8192 – 2 = 8190
Karena jumlah bit “0” adalah 13 maka 11111111.11111111.11100000.00000000
Jadi subnetmasknya adalah 255.255.244.0


6. Which type of address is 223.168.17.167/29?
a. host address
b. multicast address
c. broadcast address
d. subnetwork address

Jawaban: C

IP address diatas merupakan kelas C
/29 = 11111111.11111111.11111111.11111000
Subnet mask = 255.255.255.248
Blok subnet = 256 – 248 = 8

Net Id Range Broadcast
223.168.17.0 223.168.17.1- 223.168.17.6 223.168.17.7
223.168.17.8 223.168.17.9- 223.168.17.14 223.168.17.15
……………. …………………………….. ………………
223.168.17.160 223.168.17.161-223.168.17.166 223.168.17.167
………………. ………………………………… ………………

7. What is the correct number of usable subnetworks and hosts for the IP network address
192.168.99.0 subnetted with a /29 mask?
a. 6 networks / 32 hosts
b. 14 networks / 14 hosts
c. 30 networks / 6 hosts
d. 62 networks / 2 hosts

Jawaban: C

/29 = 11111111.11111111.11111111.11111000
Subnet masknya = 255.255.255.248
Block subnet = 256 – 248 = 8
Host = 23-2 = 6
Subnet = 25-2 = 30

8. Company XYZ uses a network address of 192.168.4.0. It uses the mask of
255.255.255.224 to create subnets. What is the maximum number of usable hosts in each
subnet?
a. 6
b. 14
c. 30
d. 62

Jawaban: C

255.255.255.224 = / 27
1111111.1111111.1111111.11100000
Maka, host = 25 – 2 = 30


9. A company is planning to subnet its network for a maximum of 27 hosts. Which subnet
mask would provide the needed hosts and leave the fewest unused addresses in each subnet?
a. 255.255.255.0
b. 255.255.255.192
c. 255.255.255.224
d. 255.255.255.240
e. 255.255.255.248

Jawaban: C

Yang mendekati 27 dan tidak melebihi jauh yaitu 24, dan host dihitung dari kanan kekiri
11111111.11111111.11111111.11100000
Subnetnya 255.255.255.224


10. An IP network address has been subnetted so that every subnetwork has 14 usable host IP
addresses. What is the appropriate subnet mask for the newly created subnetworks?
a. 255.255.255.128
b. 255.255.255.224
c. 255.255.255.240
d. 255.255.255.248
e. 255.255.255.252

Jawaban: C

Yang mendekati 14 dan tidak melebihi jauh yaitu 23 , dan host dihitung dari kanan kekiri…
11111111.11111111.11111111.11110000
Subnetnya 255.255.255.240


11. A company is using a Class B IP addressing scheme and expects to need as many as 100
networks. What is the correct subnet mask to use with the network configuration?
a. 255.255.0.0
b. 255.255.240.0
c. 255.255.254.0
d. 255.255.255.0
e. 255.255.255.128
f. 255.255.255.192

Jawaban: D

2^7=128
11111111 11111111 11111111 00000000
255 255 255 0


12. Given a host with the IP address 172.32.65.13 and a default subnet mask, to which
network does the host belong?
a. 172.32.65.0
b. 172.32.65.32
c. 172.32.0.0
d. 172.32.32.0

Jawaban: C

172.32.65.13 = 10101100.00100000.01000001.00001101
255.255.0.0 = 11111111.11111111.00000000.00000000
10101100.00100000.00000000.00000000
172 . 32 . 0 . 0

13. What is the subnetwork number of a host with an IP address of 172.16.210.0/22?
a. 172.16.42.0
b. 172.16.107.0
c. 172.16.208.0
d. 172.16.252.0
e. 172.16.254.0

Jawaban: C

/22 = 11111111.11111111.11111100.00000000 = 255.255.252.0
172.16.210.0 = 10101100.00010000.11010010.00000000
255.255.252.0 = 11111111.11111111.11111100.00000000
10101100.00010000.11010000.00000000
172 . 16 . 208 . 0

14 Which of the following IP addresses fall into the CIDR block of 115.64.4.0/22? (Choose
three.)
a. 115.64.8.32
b. 115.64.7.64
c. 115.64.6.255
d. 115.64.3.255
e. 115.64.5.128
f. 115.64.12.128

Jawaban: C, D, & E

/22 = 255.255.252.0
Block subnet 256 – 252 = 4
115.64.4.1 – 115.64.7.255

15. What is the subnetwork address for a host with the IP address 200.10.5.68/28?
a. 200.10.5.56
b. 200.10.5.32
c. 200.10.5.64
d. 200.10.5.0

Jawaban: C

/28 = 11111111.11111111.11111111.11110000 = 255.255.255.240
200.10.5.68 = 11001000.00001010.00000101.01000100
255.255.252.0 = 11111111.11111111.11111111.11110000
11001000.00001010.00000101.01000000
200 . 10 . 5 . 64

16. The network address of 172.16.0.0/19 provides how many subnets and hosts?
a. 7 subnets, 30 hosts each
b. 7 subnets, 2046 hosts each
c. 7 subnets, 8190 hosts each
d. 8 subnets, 30 hosts each
e. 8 subnets, 2046 hosts each
f. 8 subnets, 8190 hosts each

Jawaban: F

/19 = 11111111 11111111 11100000 00000000
Subnet 2^3=8
Host 2^13=8190


17. You need 500 subnets, each with about 100 usable host addresses per subnet. What mask
will you assign using a Class B network address?
a. 255.255.255.252
b. 255.255.255.128
c. 255.255.255.0
d. 255.255.254.0

Jawaban: B


Subnet 2^9=(>500)
Host 2^7=(>100)

11111111 11111111 11111111 10000000
255 255 255 128

Subnetnya 255.255.255.128


18. What is the subnetwork number of a host with an IP address of 172.16.66.0/21?
a. 172.16.36.0
b. 172.16.48.0
c. 172.16.64.0
d. 172.16.0.0

Jawaban: C


/21 = 11111111.11111111.11111000.00000000 = 255.255.248.0
172.16.66.0 = 10101100.00010000.01000010.00000000
255.255.248.0 = 11111111.11111111.11111000.00000000
10101100.00010000.01000000.00000000
172 . 16 . 64 . 0



19. What mask would you assign to the network ID of 172.16.0.0 if you needed about 100
subnets with about 500 hosts each?
a. 255.255.255.0
b. 255.255.254.0
c. 255.255.252.0
d. 255.255.0.0

Jawaban: B

26<100<27 dan subnet dihitung dari kiri kekanan
11111111   11111111        11111110        00000000
    255              255                  254                    0
Subnetnya 255.255.254.0


20. You need to configure a server that is on the subnet 192.168.19.24/29. The router has the
first available host address. Which of the following should you assign to the server?
a. 192.168.19.0 255.255.255.0
b. 192.168.19.33 255.255.255.240
c. 192.168.19.26 255.255.255.248
d. 192.168.19.31 255.255.255.248
e. 192.168.19.34 255.255.255.240

Jawaban: C

/ 29 = 11111111.11111111.11111111.11111000 =
   255     .     255     .     255     .     248
Blok subnet = 256 – 248 = 8
      
Net Id                           Range                                               Broadcast
         192.168.19.0     192.168.19.1 - 192.168.19.6                        192.168.19.7
         192.168.19.8      192.168.19.9 - 192.168.19.14                    192.168.19.15
         192.168.19.16    192.168.19.17 - 192.168.19.22                  192.168.19.23
         192.168.19.24    192.168.19.25 - 192.168.19.30                   192.168.19.31

21. You need a minimum of 300 subnets with a maximum of 50 hosts per subnet. Which of
the following masks will support the business requirements? (Choose two.)
a. 255.255.255.0
b. 255.255.255.128
c. 255.255.252.0
d. 255.25.255.224
e. 255.255.255.192
f. 255.255.248.0

Jawaban: B & E

28<300<29 karena subnet dihitung dari kiri kekanan…
11111111.11111111.11111111.10000000


Subnetnya 255.255.255.128

25<50<26 karena host dihitung dari kanan kekiri…
11111111.11111111.11111111.11000000
 

Subnetnya 255.255.255.192

22. If an Ethernet port on a router were assigned an IP address of 172.16.112.1/25, what
would be the valid subnet address of this host?
a. 172.16.112.0
b. 172.16.0.0
c. 172.16.96.0
d. 172.16.255.0
e. 172.16.128.0

Jawaban: A

/25 = 11111111.11111111.11111111.10000000
255   .255         .255             .128
172.16.112.1          = 10101100.00010000.01110000.00000001
255.255.255.128    = 11111111.11111111.11111111.10000000
                                  10101100.00010000.01110000.00000000
                                       172     .      16      .     112     .      0

23. Refer to the exhibit. The internetwork in the exhibit has been assigned the IP address
172.20.0.0. What would be the appropriate subnet mask to maximize the number of networks
available for future growth?

a. 255.255.224.0
b. 255.255.240.0
c. 255.255.248.0
d. 255.255.252.0
e. 255.255.254.0

Jawaban: D

Jumlah Host Keseluruhan= 3350
Host = 2^12 – 2 = 4094
Maka netmask yang sesuai adalah :

11111111   11111111        11110000        00000000
    255              255                 240                     0


24. You have a network with a subnet of 172.16.17.0/22. Which are valid host addresses?
a. 172.16.17.1 255.255.255.252
b. 172.16.0.1 255.255.240.0
c. 172.16.20.1 255.255.254.0
d. 172.16.16.1 255.255.255.240
e. 172.16.18.255 255.255.252.0
f. 172.16.0.1 255.255.255.0

Jawaban: E

/22 = 11111111.11111111.11111100.00000000
      = 255               .255            .252        .0
Block subnet = 256 – 252 = 4
172.16.17.0            172.16.17.1 – 172.168.17.2                172.16.17.3
--------------             ---------------------------------                ---------------


25. Your router has the following IP address on Ethernet0: 172.16.112.1/20. How many hosts
can be accommodated on the Ethernet segment?
a. 1024
b. 2046
c. 4094
d. 4096
e. 8190

Jawaban: C


/20 = 11111111.1111111.11110000.00000000
       =      255                .255        .240            .0
Host = 212 – 2 = 4094


26. You have a /27 subnet mask. Which of the following are valid hosts? (Choose three.)
a. 11.244.18.63
b. 90.10.170.93
c. 143.187.16.56
d. 192.168.15.87
e. 200.45.115.159
f. 216.66.11.192

Jawaban: : B, C, & D
/27 = 255.255.255.224
Kelas C
Subnet 2^3=8
Host 2^5-2=30
Blok subnet = 256 – 224 = 32
32, 64, 96, 128,…..


27. You have a Class B network ID and need about 450 IP addresses per subnet. What is the
best mask for this network?
a. 255.255.240.0
b. 255.255.248.0
c. 255.255.254.0
d. 255.255.255.0

Jawaban: C

Host 2^9-2=510 (>450)

11111111   11111111        11111110        00000000
     255            255                  254                     0

Subnetmasknya 255.255.254.0
 


28. Host A is connected to the LAN, but it cannot connect to the Internet. The host
configuration is shown in the exhibit. What are the two problems with this configuration?
(Choose two.)



a. The host subnet mask is incorrect.
b. The host is not configured for subnetting.
c. The default gateway is a network address.
d. The default gateway is on a different network than the host.
e. The host IP address is on a different network from the Serial interface of the router.
Jawaban: A & D

11111111 11111111 11111111 11100000
255 255 255 224

/ 27 = subnet mask = 255.255.255.224

Block subnetnya adalah = 256 – 224 = 32
32, 64, 96, 128,…