You are on page 1of 19

Interfaces.

- Là các kết nối vật lý hoặc logic mà firewall sử dụng để kết nối với mạng và giao
tiếp với các thiết bị khác trong mạng đó.
1. Interface settings.
config system interface
edit <name>
set mode {static | dhcp | pppoe}
set ip <IP_address/netmask>
set security-mode {none | captive-portal | 802.1X}
set device-identification {enable | disable}
set allowaccess {ping https ssh http snmp telnet fgfm radius-acct probe-
response fabric ftm}
set secondary-IP enable
config secondaryip
edit 1
set ip 9.1.1.2 255.255.255.0
set allowaccess ping https ssh snmp http
next
end
next
end
- set mode {static | dhcp | pppoe}: Xác định chế độ cấu hình cho giao diện là static
(cấu hình tĩnh), dhcp (tự động cấp phát địa chỉ IP từ DHCP server) hoặc pppoe
(cho kết nối PPPoE).
- set secondary-IP enable: Cho phép cấu hình địa chỉ IP phụ (secondary IP) trên
giao diện.
2. Aggregation and redundancy:
a. Aggregation: (Giao diện tổng hợp)
config system interface
edit "aggregate"
set vdom "root"
set ip 10.1.1.123 255.255.255.0
set allowaccess https ssh
set type aggregate
set member "port4" "port5" "port6"
set snmp-index 45
next
end
- edit "aggregate": Chọn một tên cho giao diện tổng hợp. Trong trường hợp này,
giao diện được đặt tên là "aggregate".
- set vdom "root": Xác định Virtual Domain (VDOM) cho giao diện. Trong trường
hợp này, giao diện được xác định là thuộc về VDOM gốc ("root").
- set type aggregate: Xác định loại giao diện là giao diện tổng hợp.
- set snmp-index 45: Thiết lập chỉ số SNMP cho giao diện tổng hợp.
- Định danh: Chỉ số SNMP là một số nguyên duy nhất được sử dụng để định danh
giao diện trong hệ thống quản lý mạng. Khi quản lý và giám sát giao diện từ xa
thông qua SNMP, chúng ta có thể sử dụng chỉ số này để xác định giao diện một
cách độc nhất.
- Aggregate interface là kết hợp nhiều giao diện vật lý thành một giao diện logic
duy nhất. Giúp tăng băng thông, hỗ trợ cân bằng tải, …
b. Redundancy: (Giao diện dự phòng).
- Ở loại giao diện này lưu lượng chỉ đi qua một giao diện tại một thời điểm. hoặc 4
hoặc 5 hoặc 6 thay vì đi qua cả 3 như ở Aggregate. Cấu hình này để thực hiện cấu
hình hight available cho interface trên.
config system interface
edit "redundant"
set vdom "root"
set ip 10.13.101.100 255.255.255.0
set allowaccess https http
set type redundant
set member "port4" "port5" "port6"
set snmp-index 9
next
end
3. VLAN.
a. VLANs in NAT mode:
- Trong NAT mode, thiết bị FortiGate hoạt động như một thiết bị lớp 3.

- Có 2 mạng LAN là VLAN100 và VLAN200 được kết nối với VLAN switch.
TheFortiGate internal interface kết nối với VLAN switch thông qua 802.1Q trunk.
- Giao diện có địa chỉ IP là 172.16.21.2 và kết nối với Internet.
- Khi VLAN switch nhận gói tin từ vlan100 và 200 nó sẽ chuyển gói tin thông qua
801.1Q trunk. Tại đây thì firewall sẽ áp dụng các policy cho các gói tin bên trong
mạng trước khi ra bên ngoài.
Tóm tắt cấu hình như sau:
- Cấu hình giao diện external interface.
- Thêm hai giao diện con Vlan vào giao diện mạng nội bộ.
- Thêm địa chỉ tường lửa và phạm vi địa chỉ cho mạng nội bộ và bên ngoài.
- Chính sách bảo mật bổ sung cho phép mạng VLAN để truy cập vào nhau và mạng
VLAN để truy cập vào mạng bên ngoài.
To configure the external interface:
config system interface
edit external
set mode static
set ip 172.16.21.2 255.255.255.0
end
Add VLAN subinterfaces:
config system interface
edit VLAN_100
set vdom root
set interface internal
set type vlan
set vlanid 100
set mode static
set ip 10.1.1.1 255.255.255.0
set allowaccess https ping
next
edit VLAN_200
set vdom root
set interface internal
set type vlan
set vlanid 200
set mode static
set ip 10.1.2.1 255.255.255.0
set allowaccess https ping
next
end
Add the firewall addresses:
config firewall address
edit VLAN_100_Net
set type ipmask
set subnet 10.1.1.0 255.255.255.0
next
edit VLAN_200_Net
set type ipmask
set subnet 10.1.2.0 255.255.255.0
next
end
Add security policies:
config firewall policy
edit 1
set srcintf VLAN_100
set srcaddr VLAN_100_Net
set dstintf VLAN_200
set dstaddr VLAN_200_Net
set schedule always
set service ALL
set action accept
set nat disable
set status enable
next
edit 2
set srcintf VLAN_200
set srcaddr VLAN_200_Net
set dstintf VLAN_100
set dstaddr VLAN_100_Net
set schedule always
set service ALL
set action accept
set nat disable
set status enable
next
edit 3
set srcintf VLAN_100
set srcaddr VLAN_100_Net
set dstintf external
set dstaddr all
set schedule always
set service ALL
set action accept
set nat enable
set status enable
next
edit 4
set srcintf VLAN_200
set srcaddr VLAN_200_Net
set dstintf external
set dstaddr all
set schedule always
set service ALL
set action accept
set nat enable
set status enable
next
end
- Edit1 chấp nhận tất cả các gói tin từ mạng VLAN_100 và chuyển tiếp chúng đến
mạng VLAN_200, cho phép truy cập tất cả các dịch vụ và vô hiệu hóa chuyển đổi
địa chỉ mạng (NAT).
- Edit 2 thì ngược lại chấp nhận tất cả các gói tin từ mạng VLAN_200 và chuyển
tiếp chúng đến mạng VLAN_100, cho phép truy cập tất cả các dịch vụ và vô hiệu
hóa chuyển đổi địa chỉ mạng (NAT).
- Edit3 chấp nhận gói tin từ mạng VLAN_100 và chuyển tiếp chúng đến mạng bên
ngoài qua giao diện external. Tất cả các dịch vụ và địa chỉ đích đều được chấp
nhận, và NAT được kích hoạt để chuyển đổi địa chỉ mạng nếu cần. Quy tắc này
được kích hoạt và áp dụng liên tục (always).
- Edit 4 tương tự edit3 nhưng là từ mạng VLAN_200.
b. VLANs in transparent mode:
- Transparent mode là một cấu hình hoạt động của firewall mà không yêu cầu thay
đổi địa chỉ IP của gói tin khi chúng đi qua thiết bị đó.
- FortiGate đang hoạt động ở chế độ trong suốt và được cấu hình với hai Vlan100 và
Vlan200.
- Mỗi giao diện vật lý bên trong và bên ngoài đều có hai giao diện con Vlan. Hai
mạng VLAN nội bộ được kết nối với bộ chuyển mạch Cisco 2950 để chuyển lưu
lượng đến firewall fortigate và chuyển ra giao diện bên ngoài sau đó đi vào VLAN
Router.
- Do đó ở đây em sẽ tạo một VLAN subinterface trên giao diện bên trong và một
giao diện khác trên giao diện bên ngoài, cả hai đều có cùng VLAN ID. Cuối cùng
là viết rule bảo mật cho hệ thống.
Tóm tắt các bước cấu hình:
- AddVLAN subinterfaces.
- Add security policies.
To add VLAN subinterfaces:
config system interface
edit VLAN_100_int
set type vlan
set interface internal
set vlanid 100
next
edit VLAN_100_ext
set type vlan
set interface external
set vlanid 100
next
edit VLAN_200_int
set type vlan
set interface internal
set vlanid 200
next
edit VLAN_200_ext
set type vlan
set interface external
set vlanid 200
next
end
- Tạo 4 kênh giao tiếp bao gồm bên trong và bên ngoài cho hai mạng VLAN.
To add security policies:
config firewall policy
edit 1
set srcintf VLAN_100_int
set srcaddr all
set dstintf VLAN_100_ext
set dstaddr all
set action accept
set schedule always
set service ALL
next
edit 2
set srcintf VLAN_100_ext
set srcaddr all
set dstintf VLAN_100_int
set dstaddr all
set action accept
set schedule always
set service ALL
next
edit 3
set srcintf VLAN_200_int
set srcaddr all
set dstintf VLAN_200_ext
set dstaddr all
set action accept
set schedule always
set service ALL
next
edit 4
set srcintf VLAN_200_ext
set srcaddr all
set dstintf VLAN_200_int
set dstaddr all
set action accept
set schedule always
set service ALL
next
end
- Edit1 cho phép tất cả các gói tin từ VLAN_100_int được chuyển đến
VLAN_100_ext mà không hạn chế theo địa chỉ nguồn hoặc đích, và cho phép truy
cập tất cả các dịch vụ.
- Edit2 cho phép tất cả các gói tin từ VLAN_100_ext được chuyển đến
VLAN_100_int.
- Edit 3-4 tương tự với edit 1-2.
4. MAC VLANs nâng cao.
- Tính năng mạng cục bộ ảo (VLAN) tạo ra các VLAN dựa trên địa chỉ MAC
(Media Access Control) của thiết bị. Điều này cho phép phân chia mạng thành các
phân đoạn nhỏ hơn.
a. Ví dụ 1: Cấu hình MAC Vlan nâng cao cho nhiều VDOM sử dụng cùng một
giao diện hoặc Vlan:
- Ở đây port1 được chia nhỏ thành 3 vlan với địa chỉ mac khác nhau.

To configure enhanced MAC VLAN in the CLI:


config system interface
edit port1.emacvlan1
set vdom VDOM1
set type emac-vlan
set interface port1
next
edit port 1.emacvlan2
set vdom VDOM2
set type emac-vlan
set interface port1
next
edit port1.emacvlan3
set vdom VDOM3
set type emac-vlan
set interface port1
next
end
5. Inter-VDOM routing. (VDOM: Vitural domain).
- Định tuyến VDOM là cấu hình cho phép VDOM giao tiếp nội bộ với nhau. Ví dụ
như từ port1 chúng ta chia thành 3 VDOM thì có nghĩa là chúng ta đã tạo thành 3
firewall nhỏ hơn là 3 VDOM đó trên cùng 1 port.
To configure a VDOM link in the CLI:
config global
config system vdom-link
edit "<vdom-link-name>"
set type {ppp | ethernet}
next
end
config system interface
edit "<vdom-link-name0>"
set vdom "<VDOM Name>"
set type vdom-link
next
edit "<vdom-link-name1>"
set vdom "<VDOM Name>"
set type vdom-link
next
end
end
To delete a VDOM link in the CLI:
config global
config system vdom-link
delete <VDOM-LINK-Name>
end
end
Example:

- Hai bộ phận của công ty, Kế toán và Bán hàng, được kết nối với một FortiGate.
Công ty sử dụng một ISP duy nhất để kết nối với Internet. (Internet Service
Provider - Nhà cung cấp Dịch vụ Internet).
To create the Sales and Accounting VDOMs:
config global
config vdom
edit Accounting
next
edit Sales
next
end
end
Configure the physical interfaces:
- Ví dụ này sử dụng ba giao diện trên thiết bị FortiGate: port2 (nội bộ), port3
(DMZ), và port1 (bên ngoài). Mỗi giao diện Port2 và port3 đều có mạng của bộ
phận được kết nối. Port1 dành cho tất cả lưu lượng truy cập đến và từ Internet và
sử dụng DHCP để định cấu hình địa chỉ IP của nó, điều này phổ biến với nhiều
ISP.
config global
config system interface
edit port2
set alias AccountingLocal
set vdom Accounting
set mode static
set ip 172.100.1.1 255.255.0.0
set allowaccess https ping ssh
set description "The accounting dept. internal interface"
next
edit port3
set alias SalesLocal
set vdom Sales
set mode static
set ip 192.168.1.1 255.255.0.0
set allowaccess https ping ssh
set description "The sales dept. internal interface"
next
edit port1
set alias ManagementExternal
set vdom root
set mode dhcp
set allowaccess https ssh snmp
set description "The system wide management interface."
next
end
end
Configure the VDOM links:
- Để hoàn tất kết nối giữa mỗi VDOM và VDOM managerment, chúng ta thêm hai
liên kết VDOM . Một cặp là liên kết Kế toán – quản lý và liên kết còn lại là liên
kết Bán hàng – quản lý.
To configure the Accounting and management VDOM link:
config global
config system vdom-link
edit AccountVlnk
next
end
config system interface
edit AccountVlnk0
set vdom Accounting
set ip 11.11.11.2 255.255.255.0
set allowaccess https ping ssh
set description "Accounting side of the VDOM link"
next
edit AccountVlnk1
set vdom root
set ip 11.11.11.1 255.255.255.0
set allowaccess https ping ssh
set description "Management side of the VDOM link"
next
end
end
- Tạo ra hai giao diện ảo (interface) để kết nối giữa các VDOM khác nhau trên thiết
bị cho accounting và root.
To configure the Sales and management VDOM link:
config global
config system vdom-link
edit SalesVlnk
next
end
config system interface
edit SalesVlnk0
set vdom Sales
set ip 12.12.12.2 255.255.255.0
set allowaccess https ping ssh
set description "Sales side of the VDOM link"
next
edit SalesVlnk1
set vdom root
set ip 12.12.12.1 255.255.255.0
set allowaccess https ping ssh
set description "Management side of the VDOM link"
next
end
end
To configure the firewall policies from AccountingLocal to Internet:
config vdom
edit Accounting
config firewall policy
edit 1
set name "Accounting-Local-to-Management"
set srcintf port2
set dstintf AccountVlnk0
set srcaddr all
set dstaddr all
set action accept
set schedule always
set service ALL
set nat enable
next
end
next
edit root
config firewall policy
edit 2
set name "Accounting-VDOM-to-Internet"
set srcintf AccountVlnk1
set dstintf port1
set srcaddr all
set dstaddr all
set action accept
set schedule always
set service ALL
set nat enable
next
end
next
end
To configure the firewall policies from SalesLocal to the Internet:
config vdom
edit Sales
config firewall policy
edit 3
set name "Sales-local-to-Management"
set srcintf port3
set dstintf SalesVlnk0
set srcaddr all
set dstaddr all
set action accept
set schedule always
set service ALL
set nat enable
next
end
next
edit root
config firewall policy
edit 4
set name "Sales-VDOM-to-Internet"
set srcintf SalesVlnk1
set dstintf port1
set srcaddr all
set dstaddr all
set action accept
set schedule always
set service ALL
set nat enable
next
end
next
end

You might also like