Trước khi bắt đầu cấu hình cluster, hãy xóa hết cấu hình hiện có để tránh lỗi phát sinh trong quá trình cấu hình cluster. Trong mỗi thiết bị srx thực hiện các bước sau:
Đầu tiên, hãy xóa tất cả các logical interface dùng cho control link/plane(ge-0/0/1) & Data/fabric link/plane(ge-0/0/2).
***Note: Control link và Data link khác nhau ở mỗi model SRX
delete system host-name
delete vlans delete interfaces vlan delete security delete interfaces ge-0/0/1 delete interfaces ge-0/0/2 delete interfaces ge-0/0/3 unit 0 family ethernet-switching delete interfaces ge-0/0/4 unit 0 family ethernet-switching
Sau khi xoá kiểm tra và chắc chắn rằng không còn ethernet-switching nào
root@srx1# show | match ethernet-switching | count
Count: 0 lines
[edit]
root@srx1#
Sau đó, kết nối vật lý hai thiết bị và đảm bảo rằng chúng là cùng một loại.
Ví dụ, trên SRX340 kết nối cổng control ports trên node 0 và node 1.
***Lưu ý: Đối với các thiết bị SRX300, SRX320, SRX340 và SRX345, hãy kết nối ge-0/0/1 trên node 0 với ge-0/0/1 trên node 1.
1. Cấu hinh hai thiết bị ở chế độ cluster và khởi động lại. Việc cấu hình được thực hiện trên cả hai thiết bị
On node 0:
---------------
user@host> set chassis cluster cluster-id 1 node 0 reboot
On node 1:
---------------
user@host> set chassis cluster cluster-id 1 node 1 reboot
Sau khi khởi động lại kiểm tra tại dấu nhắc của srx1 node0, bạn sẽ thấy dấu nhắc thay đổi như bên dưới:
{hold:node0}
root@srx1>
{secondary:node0}
root@srx1>
{primary:node0}
root@srx1>
Kiểm tra tình trạng cluster
root@srx1> show chassis cluster status
Cluster ID: 1
Node Priority Status Preempt Manual failover
Redundancy group: 0 , Failover count: 1
node0 1 primary no no
node1 1 secondary no no
Sau khi cluster được thiết lập, đối với thiết bị SRX340 interface ge-0/0/1 trên node 1 sẽ chuyển thành ge-5/0/1.
2. Cấu hình tên thiết bị và địa chỉ IP quản lý cho mỗi thiết bị, việc cấu hình chỉ thực hiện trên node đầu tiên (srx-node0)
set groups node0 system host-name srx-nd0
set groups node0 interfaces fxp0 unit 0 family inet address 192.168.33.1/24
set groups node1 system host-name srx-nd1
set groups node1 interfaces fxp0 unit 0 family inet address 192.168.33.2/24
3. Cấu hình ‘apply-groups’
set apply-groups "${node}"
4. Định nghĩa các interfaces được sử dụng cho kết nối fab (data plane links for RTO sync) bằng cách sử dụng các interfaces ge-0/0/2 từ mỗi node. Việc cấu hình các liên kết fabric chỉ thực hiện trên node đầu tiên (srx-node0)
set interfaces fab0 fabric-options member-interfaces ge-0/0/2
set interfaces fab1 fabric-options member-interfaces ge-5/0/2
# Sau khi commit, cấu hình cũng sẽ đồng bộ vào node srx-node1. Bây giờ hãy kiểm tra cluster interfaces status
root@srx1> show chassis cluster interfaces
Control link 0 name: fxp1
Control link status: Up
Fabric interfaces:
Name Child-interface Status
fab0 fe-0/0/5 up
fab0
fab1 fe-2/0/5 up
fab1
Fabric link status: Up
5. Thiết lập redundancy group 0 cho Routing Engine failover properties và thiết lập redundancy group 1 cho tất cả các interfaces. Một cluster không có redundancy group là vô dụng. RG0 được sử dụng cho control plane và RG1 sẽ là RG dịch vụ.
set chassis cluster reth-count 2
set chassis cluster redundancy-group 0 node 0 priority 200
set chassis cluster redundancy-group 0 node 1 priority 100
set chassis cluster redundancy-group 1 node 0 priority 200
set chassis cluster redundancy-group 1 node 1 priority 100
6. Thiết lập interface monitoring để giám sát tình trạng của các interface và kích hoạt redundancy group failover .
****** Lưu ý: Juniper không khuyến nghị interface monitoring cho redundancy group 0 vì nó khiến control plane chuyển từ node này sang node khác trong trường hợp xảy ra lỗi interface.
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-0/0/4 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-5/0/3 weight 255
set chassis cluster redundancy-group 1 interface-monitor ge-5/0/4 weight 255
#Hãy kiểm tra cluster configuration
{primary:node0}
root@SRX> show configuration chassis cluster
reth-count 2;
redundancy-group 0 {
node 0 priority 200;
node 1 priority 100;
}
redundancy-group 1 {
node 0 priority 200;
node 1 priority 100;
preempt;
interface-monitor {
ge-0/0/3 weight 255;
ge-0/0/4 weight 255;
ge-5/0/3 weight 255;
ge-5/0/4 weight 255;
}
}
7. Thiết lập các redundant ethernet (reth) và chỉ định redundant interface cho 1 zone.
set interfaces ge-0/0/3 gigether-options redundant-parent reth0
set interfaces ge-5/0/3 gigether-options redundant-parent reth0
set interfaces reth0 redundant-ether-options redundancy-group 1
set interfaces reth0 unit 0 family inet address 198.51.100.1/24
set interfaces ge-0/0/4 gigether-options redundant-parent reth1
set interfaces ge-5/0/4 gigether-options redundant-parent reth1
set interfaces reth1 redundant-ether-options redundancy-group 1
set interfaces reth1 unit 0 family inet address 203.0.113.233/24
set security zones security-zone Trusted
set security zones security-zone Untrusted
set security zones security-zone Trusted host-inbound-traffic system-services all
set security zones security-zone Untrusted host-inbound-traffic system-services all
set security zones security-zone Untrust interfaces reth1.0
set security zones security-zone Trust interfaces reth0.0
#Nếu bạn muốn tạo một subinterface với vlan tagging, hãy làm như sau
set interfaces reth0 vlan-tagging
set interfaces reth0 unit 150 vlan-id 150
set interfaces reth0 unit 150 family inet address 192.168.150.200/24
set interfaces reth1 unit 0 family inet address 10.16.9.1/24
set security zones security-zone Trusted interfaces reth0.150
set security zones security-zone Untrusted interfaces reth1.0
Các lệnh kiểm tra và xác minh cấu hình
show chassis cluster status
show chassis cluster interfaces
show chassis cluster statistics
show chassis cluster control-plane statistics
show chassis cluster data-plane statistics
show chassis cluster status redundancy-group 1
show configuration
root@srx# run show configuration
## Last commit: 2017-08-07 16:41:31 GMT+6 by root
version 15.1X49-D90.7;
groups {
node0 {
system {
host-name srx-nd0;
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 192.168.33.1/24;
}
}
}
}
}
node1 {
system {
host-name srx-nd1;
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 192.168.33.2/24;
}
}
}
}
}
}
apply-groups "${node}";
system {
auto-snapshot;
time-zone GMT+6;
root-authentication {
encrypted-password "$5$ZsCeZsruXu$TZ8Kvvzb/mxQOMqf8AxJkFqW.r5OZFnrdagxRl8LSH."; ## SECRET-DATA
}
services {
ssh;
telnet;
}
}
}
chassis {
cluster {
reth-count 2;
redundancy-group 0 {
node 0 priority 200;
node 1 priority 100;
}
redundancy-group 1 {
node 0 priority 200;
node 1 priority 100;
preempt;
interface-monitor {
ge-0/0/3 weight 255;
ge-0/0/4 weight 255;
ge-5/0/3 weight 255;
ge-5/0/4 weight 255;
}
}
}
}
security {
screen {
ids-option untrust-screen {
icmp {
ping-death;
}
ip {
source-route-option;
tear-drop;
}
tcp {
syn-flood {
alarm-threshold 1024;
attack-threshold 200;
source-threshold 1024;
destination-threshold 2048;
timeout 20;
}
land;
}
}
}
nat {
source {
rule-set nsw_srcnat {
from zone Internal;
to zone Internet;
rule nsw-src-interface {
match {
source-address 0.0.0.0/0;
destination-address 0.0.0.0/0;
}
then {
source-nat {
interface;
}
}
}
}
}
}
policies {
from-zone Internal to-zone Internet {
policy All_Internal_Internet {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
}
zones {
security-zone Internal;
security-zone Internet {
screen untrust-screen;
}
security-zone Trusted {
host-inbound-traffic {
system-services {
all;
}
}
interfaces {
reth0.0;
}
}
security-zone Untrusted {
host-inbound-traffic {
system-services {
all;
}
}
interfaces {
reth1.0;
}
}
}
}
interfaces {
ge-0/0/3 {
gigether-options {
redundant-parent reth0;
}
}
ge-0/0/4 {
gigether-options {
redundant-parent reth1;
}
}
ge-5/0/3 {
gigether-options {
redundant-parent reth0;
}
}
ge-5/0/4 {
gigether-options {
redundant-parent reth1;
}
}
fab0 {
fabric-options {
member-interfaces {
ge-0/0/2;
}
}
}
fab1 {
fabric-options {
member-interfaces {
ge-5/0/2;
}
}
}
fxp0 {
unit 0 {
family inet;
}
}
reth0 {
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 198.51.100.1/24;
}
}
}
reth1 {
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 203.0.113.233/24;
}