Skip to content

A4_2

1. NETWORK INFRASTRUCTURE & ROUTING

Router Components

  • CPU, RAM (running-config), Flash, NVRAM (startup-config)
  • Interfaces: Management (console, miniUSB, aux), LAN (GigaEthernet, FastEthernet), WAN (serial)
  • Vai trò: LAN segmentation, routing, forwarding

Định tuyến (Routing)

  • Loại định tuyến: L (Local), C (Connected), S (Static), R (RIP), D (EIGRP), O (OSPF)
  • Source/Destination IP thay đổi theo IP interface
  • MAC thay đổi theo interface đến default gateway

2. STATIC ROUTING

Ưu/Nhược điểm

Ưu điểm: Bảo mật cao, ít băng thông/CPU, đường đi xác định
Nhược điểm: Khó cấu hình/bảo trì, dễ lỗi mạng lớn, cần biết toàn bộ topology

Các loại Static Route

  1. Standard static route
  2. Default static route
  3. Summary static route
  4. Floating static route

Cấu hình

Text Only
Router(config)# ip route <destination> <mask> <next-hop/interface>

3. DYNAMIC ROUTING - RIP

Đặc điểm

  • Giao thức: Distance Vector (Bellman-Ford algorithm)
  • Metric: Hop count
  • Update: Mỗi 30s qua UDP port 520
  • RIPv1: Broadcast 255.255.255.255, không hỗ trợ VLSM
  • RIPv2: Multicast 224.0.0.9, hỗ trợ VLSM/CIDR, có authentication

Cấu hình

Text Only
Router(config)# router rip
Router(config-router)# version 2
Router(config-router)# network <network-address>
Router(config-router)# passive-interface <interface>
Router(config-router)# default-information originate

4. DYNAMIC ROUTING - OSPF

Đặc điểm

  • Giao thức: Link-State (Dijkstra algorithm)
  • Hiểu rõ topology mạng
  • Hội tụ nhanh hơn RIP
  • Dùng cho mạng lớn

Cấu hình

Text Only
Router(config)# router ospf <process-id>
Router(config-router)# network <network> <wildcard-mask> area <area-id>
Router(config-router)# passive-interface <interface>

5. VLAN & INTER-VLAN ROUTING

3 phương pháp Inter-VLAN

  1. Legacy: Mỗi VLAN 1 interface router (lãng phí cổng)
  2. Router-on-a-Stick: Dùng sub-interface, trunk port
  3. Multilayer Switch: Dùng SVI (Switch Virtual Interface), hiệu quả nhất

Cấu hình Router-on-a-Stick

Text Only
Router(config)# interface g0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0

Cấu hình VLAN trên Switch

Text Only
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Cấu hình Trunk

Text Only
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30

6. DHCP

DHCP Process (DORA)

  1. Discover (broadcast)
  2. Offer (từ server)
  3. Request (client chọn IP)
  4. Acknowledge (server xác nhận)

Router làm DHCP Server

Text Only
Router(config)# ip dhcp pool POOL_NAME
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.1.1
Router(dhcp-config)# dns-server 8.8.8.8
Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10

Router làm DHCP Relay

Text Only
Router(config-if)# ip helper-address <DHCP-server-IP>

7. NAT (Network Address Translation)

Mục đích

  • Chuyển private IP → public IP để ra Internet
  • Tiết kiệm địa chỉ IPv4 public

NAT Operation

  • Inside Local: IP private trong LAN
  • Inside Global: IP public ra ngoài
  • Outside Local/Global: IP đích

Cấu hình NAT Overload (PAT)

Text Only
Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
Router(config)# ip nat inside source list 1 interface g0/0 overload
Router(config)# interface g0/1
Router(config-if)# ip nat inside
Router(config)# interface g0/0
Router(config-if)# ip nat outside

Port Forwarding

Text Only
Router(config)# ip nat inside source static tcp 192.168.1.10 80 <public-IP> 80

8. ACL (Access Control List)

Wildcard Mask

  • 0 = phải khớp bit
  • 1 = bỏ qua bit
  • host = 0.0.0.0
  • any = 255.255.255.255

Standard ACL (1-99, 1300-1999)

  • Lọc theo source IP only
  • Đặt gần destination
Text Only
Router(config)# access-list 1 deny 192.168.1.0 0.0.0.255
Router(config)# access-list 1 permit any
Router(config-if)# ip access-group 1 out

Extended ACL (100-199, 2000-2699)

  • Lọc theo source, destination, protocol, port
  • Đặt gần source
Text Only
Router(config)# access-list 100 deny tcp 192.168.1.0 0.0.0.255 host 10.1.1.10 eq 22
Router(config)# access-list 100 permit ip any any
Router(config-if)# ip access-group 100 in

Quy tắc ACL

  • Implicit deny ở cuối
  • Xử lý từ trên xuống (top-down)
  • 1 ACL/protocol/direction/interface

9. WINDOWS SERVER

Roles & Services

  • Web Server (IIS)
  • DNS Server: Phân giải tên miền
  • DHCP Server: Cấp IP tự động
  • File Server: Chia sẻ file, phân quyền NTFS
  • Active Directory Domain Services (AD DS)

File Sharing Permissions

Permission Quyền
Read Xem file/folder, chạy program
Change Read + tạo/sửa/xóa file
Full Control Change + thay đổi permission, ownership

Active Directory

  • Objects: User, Computer, Group, OU (Organizational Unit)
  • Group Policy: Áp dụng chính sách (password policy, software restriction)
  • Domain Controller: Quản lý xác thực tập trung

10. LINUX ADMINISTRATION

User Management

Bash
useradd -u <uid> -g <group> -G <groups> -c "comment" -d /home/user username
passwd username
usermod -aG <group> username
userdel -r username

Group Management

Bash
groupadd -g <gid> groupname
groupmod -n <new-name> <old-name>
groupdel groupname

File quan trọng

  • /etc/passwd: Thông tin user
  • /etc/shadow: Mật khẩu mã hóa
  • /etc/group: Thông tin group

Network Commands

Bash
ifconfig / ip addr show
route -n / ip route
ping <IP>
netstat -tuln
ssh user@host

Cấu hình Network

  • File: /etc/sysconfig/network-scripts/ifcfg-eth0
  • Set IP, gateway, DNS

11. VIRTUALIZATION

Phân loại

  1. Full Virtualization: Guest OS không cần sửa (VMware, VirtualBox)
  2. Para-Virtualization: Guest OS cần sửa, hiệu năng cao (Xen)
  3. OS-level: Container (Docker, LXC)

Components

  • Hypervisor/VMM: Quản lý VM
  • Type 1 (Bare-metal): ESXi, Hyper-V
  • Type 2 (Hosted): VMware Workstation, VirtualBox

12. NETWORK MANAGEMENT (FCAPS)

  1. Fault Management: Phát hiện/sửa lỗi
  2. Configuration Management: Quản lý cấu hình
  3. Accounting Management: Theo dõi sử dụng tài nguyên
  4. Performance Management: Giám sát hiệu năng
  5. Security Management: Bảo mật

Protocols

  • SNMP (Simple Network Management Protocol)
  • Agent: Thu thập thông tin trên thiết bị
  • NMS: Network Management System (Nagios, Zabbix)

CÔNG THỨC TÍNH NHANH

Subnet Mask ↔ CIDR

  • /24 = 255.255.255.0 (256 host, 254 usable)
  • /25 = 255.255.255.128 (128 host, 126 usable)
  • /26 = 255.255.255.192 (64 host, 62 usable)

Wildcard Mask

  • Wildcard = 255.255.255.255 - Subnet Mask
  • VD: 255.255.255.0 → Wildcard = 0.0.0.255

Số host

  • 2^n - 2 (n = số bit host)

LƯU Ý THI:

  • Nhớ syntax lệnh cấu hình router/switch
  • Phân biệt Standard vs Extended ACL
  • Hiểu DHCP DORA, NAT operation
  • Nắm Inter-VLAN routing 3 phương pháp
  • Thuộc port number: HTTP(80), HTTPS(443), SSH(22), Telnet(23), DNS(53), DHCP(67/68)