Summary ¶
Firmware 更新 ¶
今年のはじめぐらいから、 Basic Auth が外されて誰でもダウンロードできるようになったためこちらからダウンロードする。
Network 越しに HTTP でダウンロードしてアップグレードした。
1
2
3
4
5
6
7
8
9
| enable-config
interface GigaEthernet0.0
ip address dhcp
no shutdown
exit
software-update http://192.168.13.81/ix2215-boot-24.1-gate-ms-10.9.11.rap auto-reload
|
初期設定 ¶
- ホスト名の設定
- Timezone の設定
terminal suppress-emanon
コンソールや TELNET ログイン時のユーザーアカウント要求でリターン入力のみを行った場合に、認証動作を抑止。
1
2
3
| hostname ix2215-01b
timezone +09 00
terminal suppress-emanon
|
MTU ¶
IX シリーズでは ip tcp adjust-mss auto
という TCP MSS を自動最適化する設定がある。
これを利用すると、 Interface MTU から適切に引いた MSS を設定するそのため Interface MTU は正確に設定するべき。
また、Tunnel Interface を利用する場合は Interface ではなく Tunnel Interface に設定する必要がある。
WAN が MTU 1440
の場合は下記の設定が必要。
1
2
3
4
5
6
7
8
9
10
| interface GigaEthernet0.0
description WAN link
ip address dhcp
ip mtu 1440
no shutdown
interface Tunnel0.0
description To Cloud
ip tcp adjust-mss auto
no shutdown
|
Syslog ¶
| | |
---|
syslog facility | local3 | 弊宅では local3 を Router にしている |
syslog ip host | 192.168.2.1 | Syslog Server |
syslog ip source | 192.0.2.2 | IPv4 しか設定できないため GigaEthernet2.0 IP に設定 |
1
2
3
4
5
6
| syslog facility local3
syslog id hostname
syslog ip enable
syslog ip host 192.168.2.1
syslog ip source 192.0.2.2
syslog timestamp datetime
|
logging ¶
1
2
3
4
5
6
7
8
9
10
11
12
13
| logging buffered 131072 cyclic
logging subsystem all warn
logging subsystem bgp info
logging subsystem brs info
logging subsystem circ info
logging subsystem dh6 info
logging subsystem dhc info
logging subsystem dhs info
logging subsystem dqos debug
logging subsystem gw info
logging subsystem ipwc info
logging subsystem ssh info
logging timestamp datetime
|
subsystem | Description |
---|
acl | Access Control List |
all | All subsystems |
bgp | Border Gateway Protocol |
brs | Bandwidth Reservation Subsystem |
circ | Circuit Subsystem |
dh6 | DHCP for IPv6 |
dhc | DHCP Client for IPv4 |
dhr | DHCP Relay Agent for IPv4 |
dhs | DHCP Server for IPv4 |
dns | Domain Name System |
dqos | Bandwidth Reservation Subsystem |
eap | Extensible Authentication Protocol |
gw | Router Base |
ike | Internet Key Exchange Protocol |
ike2 | IKEv2 |
ipwc | Network Monitor |
key | IPSec Key Manager |
ntp | Network Time Protocol |
sec | IPSec Traffic |
snmp | Simple Network Management Protocol |
ssh | SSH Server |
urlo | URL Offload |
Topic
以降はログ設定がされているため event-terminal
を入力すると Console にログを表示可能もう一度設定すると停止できる。
1
2
3
4
5
6
7
8
9
| ix2215-01b(config)# event-terminal
% Started event output.
2024/04/07 22:35:36 GW.040: User anonymous@ has logged off
2024/04/07 22:35:38 GW.038: User anonymous@ has logged on
ix2215-01b(config)# event-terminal
% Stopped event output.
|
ufs-cache ¶
UFS(Unified Forwarding Service)キャッシュを有効にします。
1
2
3
4
| ip ufs-cache enable
ip ufs-cache max-entries 65535
ipv6 ufs-cache enable
ipv6 ufs-cache max-entries 65535
|
username ¶
ユーザー・アカウントを作成します。
| |
---|
username | user01 |
password | mekabu |
level | administrator |
1
| username user01 password plain 1 mekabu administrator
|
VLAN の作成 ¶
UNIVERGE IX シリーズではサブインターフェースで VLAN を設定するようです。
Important
Terminal にも表示されますが VLAN 周りを変更する場合再起動が必要です。
1
2
3
4
5
| ix2215-01b(config)# interface GigaEthernet0.11
ix2215-01b(config-GigaEthernet0.11)# encapsulation dot1q ?
<1-4095> -- IEEE802.1Q VLAN-ID required
ix2215-01b(config-GigaEthernet0.11)# encapsulation dot1q 211
% You must restart the router for this configuration to take effect.
|
今回の設定では下記で設定を進める。
| VLAN | MTU |
---|
GigaEthernet0.11 | 211 | 1500 |
GigaEthernet0.12 | 212 | 1422 |
GigaEthernet0.13 | 213 | 1440 |
| | |
GigaEthernet1 | access | 1422 |
| | |
GigaEthernet2.21 | 221 | - |
GigaEthernet2:2.0 | - | |
GigaEthernet2 | VLAN |
---|
3-6 | 221 |
7-8 | 222 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| bridge irb enable
device GigaEthernet2
vlan-group 2 port 3 4 5 6
interface GigaEthernet0.11
description vlan211
encapsulation dot1q 211 tpid 8100
auto-connect
ip address dhcp receive-default metric 5
ip mtu 1500
no shutdown
!
interface GigaEthernet0.12
description vlan212
encapsulation dot1q 212 tpid 8100
auto-connect
ip address dhcp receive-default metric 10
ip mtu 1422
no shutdown
!
interface GigaEthernet0.13
description vlan213
encapsulation dot1q 213 tpid 8100
auto-connect
ip address dhcp receive-default metric 1
ip mtu 1440
no shutdown
!
interface GigaEthernet1.0
description EmergencyWAN
auto-connect
ip address dhcp receive-default
ip mtu 1422
no shutdown
!
interface GigaEthernet2.21
description vlan221
encapsulation dot1q 221 tpid 8100
auto-connect
no ip address
bridge-group 221
no shutdow
!
interface GigaEthernet2:2.0
no ip address
bridge-group 221
no shutdown
!
interface BVI21
ip address 10.2.21.3/24
bridge-group 221
no shutdown
exit
write memory
reload y
|
ACL(access-list) ¶
弊宅ではセグメントを雑に下記で切っているため、それぞれで通信できるように ACL を設定します。
Region | Subnet | CIDR | mgmt_acl |
---|
WAN | WAN | any | O |
| | | |
Cloud | | 10.1.0.0/16 | |
| mgmt | 10.1.11.0/24 | O |
| | | |
Home | | 10.2.0.0/16 | |
| mgmt | 10.2.21.0/24 | O |
1
2
3
4
5
6
7
| ip access-list mgmt_acl sequence-mode 10
! allow cloud to home ...
ip access-list mgmt_acl 10 permit ip src 10.1.11.0/24 dest any
! allow home to cloud ...
ip access-list mgmt_acl 20 permit ip src 10.2.21.0/24 dest any
|
SNMP ¶
IX シリーズでは SNMP を利用して監視を設定可能です。弊宅では Zabbix を設定し監視しているためその設定を追加します。
communityPUCLIC
: これは SNMP community です、環境に合わせて変更mgmt_acl
: ACL mgmt_acl
に記載の src からのみアクセスを許可192.0.2.1
, 192.0.2.2
: SNMP Trap を受けるサーバーBVI21
: 送信元の設定
1
2
3
4
5
6
7
8
| snmp-agent contact NOC
snmp-agent ip enable
snmp-agent ip community communityPUCLIC mgmt_acl
snmp-agent ip host 192.0.2.1 communityPUCLIC version 2
snmp-agent ip host 192.0.2.2 communityPUCLIC version 2
snmp-agent ip trap-source BVI21
snmp-agent ip trap-port 162
snmp-agent location home
|
SSH ¶
管理目的の SSH を設定します。
mgmt_acl
: ACL mgmt_acl
に記載の src からのみアクセスを許可pki private-key generate rsa
これがないと SSH でアクセス出来ません
1
2
3
4
| ssh-server ip access-list mgmt_acl
ssh-server ip enable
pki private-key generate rsa
ssh-server ip port 22
|
IPsec ¶
IX2215 では下記の暗号化方式はハードウェア処理できるため積極的に利用する。
| |
---|
機種 | IX2106/IX2107/IX2215/IX2235/IX2310/IX3315 |
暗号 | DES,3DES,AES(128/192/256) |
認証 | MD5,SHA1,SHA2(256/384/512) |
秘密鍵生成(IKE) | Diffie-Hellman |
用語の定義。
- initiator: クライアント側
- responder: サーバ側
今回は無難に下記の設定で進める。
| |
---|
ike-proposal | IKE プロポーサル名 |
aes-cbc-256 | 暗号方式 |
sha2-256 | 認証方式 |
2048-bit | DH グループの設定 |
lifetime 28800 | SA が有効である時間 |
| |
ike-policy | IKE ポリシー名 |
203.0.113.1 | SA を張る相手のアドレス |
psk-bNLdUaQ | 事前共有鍵 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| ike initial-contact always
ike proposal ike-proposal encryption aes-256 hash sha2-256 group 2048-bit lifetime 28800
ike policy ike-policy peer 203.0.113.1 key psk-bNLdUaQ mode aggressive ike-proposal
ike keepalive ike-policy 10 3
ike local-id ike-policy fqdn onsite01.example.net
ike remote-id ike-policy fqdn cloud01.example.net
ike suppress-dangling ike-policy
ike nat-traversal policy ike-policy
ipsec autokey-map ipsec-mgmt ipsec_acl peer 203.0.113.1 ipsec-proposal pfs 2048-bit
ipsec autokey-proposal ipsec-proposal esp-aes-256 esp-sha2-256 lifetime time 3600
ipsec rekey remaining-lifetime default second 60
no ipsec ike-passthru
ipsec commit-bit ipsec-mgmt
ipsec local-id ipsec-mgmt 10.11.0.0/16
ipsec remote-id ipsec-mgmt 0.0.0.0/0
|
ikev2
| | pre-shared key | IX2215 #1 | IX2215 #2 |
---|
Cloud Router #1 | 203.0.113.1 | yghpwbgvaxflietq | ix2215-01a.local | ix2215-01b.local |
Cloud Router #2 | 203.0.113.2 | qrcprhjszujjmcyz | ix2215-01a.local | ix2215-01b.local |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| ! Add the pre-shared key
ikev2 authentication psk id keyid border-01.tyo1.vultr.vpn.internal key char yghpwbgvaxflietq
ikev2 authentication psk id keyid border-02.tyo1.vultr.vpn.internal key char qrcprhjszujjmcyz
! Configure ISAKMP and IPSec Policies
ikev2 default-profile
anti-replay off
child-lifetime 28800
child-pfs 2048-bit
child-proposal enc aes-cbc-256
child-proposal integrity sha2-256
dpd interval 10
local-authentication psk id keyid ix2215-01b.tyo1.home.vpn.internal
nat-traversal force keepalive 20
negotiation-direction initiator
sa-lifetime 28800
sa-proposal dh 2048-bit
sa-proposal enc aes-cbc-256
sa-proposal integrity sha2-256
sa-proposal prf sha2-256
interface Tunnel2.0
ikev2 connect-type auto
ikev2 ipsec pre-fragment
ikev2 peer 203.0.113.1 authentication psk id keyid border-02.tyo1.vultr.vpn.internal
ip address 192.168.255.13/30
ip tcp adjust-mss auto
tunnel mode ipsec-ikev2
no shutdown
|
DNS ¶
DNS Proxy を設定する priority は値が大きい DNS サーバに優先して問い合わせます。
Topic
proxy-dns ip enable
を Interface で設定した場合その Interface からのみ問い合わせを受け付けます。
access-list を書く必要はありません。下記のようにした場合はすべての Interface から受け付けるので個人的には非推奨です。
1
2
| proxy-dns ip enable
proxy-dns ipv6 enable
|
proxy-dns ip query-response
はデフォルト 90 秒となっていて応答待ちとして長いので変更。
Global Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| proxy-dns ip max-sessions 1024
proxy-dns ipv6 max-sessions 1024
proxy-dns ip query-response 20
proxy-dns ipv6 query-response 20
! Tunnel 経由で Cloud GW に向ける
proxy-dns server 10.1.1.12 Tunnel0.1 priority 200
proxy-dns server fd::1 Tunnel1.1 priority 200
! Failback 用に local 用意しておく
! vlan213
proxy-dns interface GigaEthernet0.13 priority 130
! vlan211
proxy-dns interface GigaEthernet0.11 priority 120
! vlan212
proxy-dns interface GigaEthernet0.12 priority 110
|
Interface Configuration
1
2
3
| interface BVI21
proxy-dns ip enable
proxy-dns ipv6 enable
|
dns cache lifetime
, dns ncache lifetime
はデフォルトだと最大 720 時間になっている。
これは、名前解決が完了しこの設定値より短い場合はレスポンス TTL が採用され、大きい場合は設定値で上書きされる
弊宅では、 NAT/NAPT の時間や回線切り替わりの可能性を考慮し 300 秒( 5 分)とした溢れないか監視して調整する。
1
2
3
4
| dns cache enable
dns cache lifetime 300
dns ncache lifetime 300
dns cache max-records 1024
|
IX 自身の DNS です。
1
2
3
4
5
| ip name-server 1.1.1.1
ip name-server 1.0.0.1
ipv6 name-server 2606:4700:4700::1111
ipv6 name-server 2606:4700:4700::1001
|
DHCP ¶
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| ip dhcp enable
ip dhcp profile vlan221-dhcp
assignable-range 10.2.21.11 10.2.21.99
subnet-mask 255.255.255.0
broadcast-bit validation strict
default-gateway 10.2.21.1
dns-server 10.2.21.1
netbios-name-server 10.2.21.1
domain-name exsample.com
lease-time 1200
interface BVI21
ip dhcp binding vlan221-dhcp
|
VRRP ¶
GW 冗長化のため VRRP する。
1
2
3
4
5
6
7
8
9
10
| vrrp enable
interface BVI21
vrrp 11 authentication b2D8NdFp
vrrp 11 ip 10.2.21.1
vrrp 11 ip virtual-host
vrrp 11 preempt
vrrp 11 priority 120
vrrp 11 redirects
vrrp 11 timers advertisement 3 delay 10
|
NAT/NAPT ¶
NAT/NAPT は弊宅の場合外部接続は 4G / 5G に依存しているため現在では home 5G(hr01) を利用して接続している。
こいつの NAT/NAPT タイマー以上に設定しても無意味になるので確認したら TCP/UDP ともに 300 秒であった。
一方 IX のタイマーは下記。
| custom | defalut value | Description |
---|
dns-timeout | | 60s | Specify timeout for NAPT DNS flows |
finrst-timeout | | 60s | Specify timeout for NAPT TCP flows after a FIN or RST |
gre-timeout | | 60s | Specify timeout for NAPT GRE flows |
icmp-timeout | | 60s | Specify timeout for NAPT ICMP flows |
other-timeout | | 60s | Specify timeout for NAPT other flows |
syn-timeout | | 30s | Specify timeout for NAPT TCP SYN flows |
tcp-timeout | 300s | 900s | Specify timeout for NAPT TCP flows |
udp-timeout | | 300s | Specify timeout for NAPT UDP flows |
| | | |
max-entries | | 65535 | Specify maximum number of NAPT entries |
max-entries per-address | 1000 | 65535 | Maximum cache entries |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| interface GigaEthernet0.11
ip napt enable
ip napt translation max-entries 65535
ip napt translation max-entries per-address 1000
ip napt translation tcp-timeout 300
!
interface GigaEthernet0.12
ip napt enable
ip napt translation max-entries 65535
ip napt translation max-entries per-address 1000
ip napt translation tcp-timeout 300
!
interface GigaEthernet0.13
ip napt enable
ip napt translation max-entries 65535
ip napt translation max-entries per-address 1000
ip napt translation tcp-timeout 300
!
|
NTP ¶
NTP は記載の通り CloudFlare と INTERNET MULTIFEED 社の物を設定するが、 IP only のため IP を確認しておく。
1
2
3
4
5
6
7
8
9
| ! CloudFlare
! priority が大きいほうが優先される
ntp server 162.159.200.123 timeout 10 priority 21
! INTERNET MULTIFEED
ntp server 210.173.160.87 timeout 10 priority 11
!
ntp source BVI21
ntp retry 10
ntp interval 1024
|
NetMeister ¶
1
2
3
4
5
6
| nm ip enable
nm account <NetMeisterグループID> password <グループパスワード>
nm logging enable level info
nm management ip 10.2.21.3
nm sitename <拠点ID>
nm source-address BVI21
|
Traffic Shaping ¶
弊宅の通信回線は LTE を主に利用しているため速度のばらつきが発生しやすいため、計測速度でシェービングを実施し送出パケットの均一化を実施する。
Traffic Shaping は送信について設定するため現在の送信帯域を確認して設定する
IX2000/3000 シリーズコマンドリファレンスを見ると BC
, BE
は自動計算されるようなので設定しない。
1
2
3
4
| デフォルト値
BC...CIR ÷ 1000 (1 ミリ秒当りのビット数)
BE...0 : BC を設定している場合
BC と同じ値 : BC がデフォルト値の場合
|
name | vlan | CIR bps (Mbps) | Upload (Mbps) 実測 | Download (Mbps) |
---|
docomo home 5g | 211 | 2097152 ( 2 Mbps) | 1.89 Mbps | 187.72 |
SoftBank | 212 | 25165824 (24 Mbps) | 24.16 Mbps | 38.78 |
Rakuten | 213 | 35651584 (34 Mbps) | 34.59 Mbps | 58.02 |
- 平均レート CIR(committed information rate)
- BC(committed burst rate)
- EB(excess burst rate)
1
2
3
| # 2つの Server 宛に5回計測し平均を算出した後、0.95 を掛けた値採用する
> clear && for i in $(seq 1 1 5 ); do speedtest -s 24333 -u bps && sleep 10s; done
> clear && for i in $(seq 1 1 5 ); do speedtest -s 48463 -u bps && sleep 10s; done
|
1
2
3
4
5
6
7
8
9
10
11
12
| interface GigaEthernet0.11
service-policy enable
traffic-shape rate 2097152
!
interface GigaEthernet0.12
service-policy enable
traffic-shape rate 25165824
!
interface GigaEthernet0.13
service-policy enable
traffic-shape rate 35651584
!
|
QoS ¶
QoS を掛ける、これは特定の端末が回線を圧迫する可能性があるためネットワークに必要な通信を優先する。
IP Precedence | Description | Protocol |
---|
7 | ネットワーク制御 | netmon |
6 | インターネットワーク制御 | bgp , dhcp , dns |
5 | 最優先 | |
4 | フラッシュ オーバーライド | |
3 | フラッシュ | |
2 | 即時 | |
1 | 優先順位 | |
0 | 標準 | |
Q.1-12 インターネットVPNでQoSを行う場合の、実現手段と注意点について教えてください。
入力インタフェース、もしくは TunnelインタフェースでオリジナルパケットのToS値を書き換え、出力インタフェースでToS値に基づく送信優先制御の設定を行ってください。
出力インタフェースでは、IPsecでカプセル化されたパケットの中身を見て優先度を分けることができませんが、ToS値はオリジナルパケットの値がカプセルヘッダに引き継がれるため、ToS値を見てクラス分けを行うことが可能です。
なお、IPsecパケットに対して送信優先制御を適用した場合、優先度の高い IPsecパケットから順に出力されるため、受信側でIPsecパケットに付与されているシーケンス番号により受信確認を行う機能(アンチリプレイ機能)を有効にしていると、優先度の低いパケットが受信側で廃棄されてしまう可能性が有ります。
そのため、IPsecと QoSを併用するときは、必ずアンチリプレイ機能(※)を無効化(no ipsec anti-replayコマンド)してください。
詳しい設定例は、「設定事例集」をご参照ください。
※アンチリプレイ機能:IPsecでカプセル化されたパケットのシーケンス番号を監視し、重複して受け取ったパケットを廃棄することにより、リプレイ攻撃からの防御を行う機能。
― IPsec/IKE : FAQ : UNIVERGE IXシリーズ | NEC
class-local
は IX2215 が生成元の場合この class になるので precedence を高く設定class-default
は class わけされなかったパケットbandwidth percent
は CBQ の最小帯域
1
2
3
4
5
6
7
8
9
10
11
| policy-map pmap
class class-local
bandwidth percent 10
set ip precedence 6
set ipv6 precedence 6
class class-default
bandwidth percent 10
interface GigaEthernet0.0
service-policy enable
service-policy output pmap
|
watch-group ¶
Linux watchdog のようにモニタリングして設定を変えることができるため設定しておく。
参考情報 ¶
IP Address の確認 ¶
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| ix2215-01b# show ip address
Interface GigaEthernet0.11 is up, line protocol is up
Internet address is 192.168.11.51/24
Broadcast address is 192.168.11.255
Address determined by DHCP
Primary DNS server is 192.168.11.1
Interface GigaEthernet0.12 is up, line protocol is up
Internet address is 10.2.12.57/24
Broadcast address is 10.2.12.255
Address determined by DHCP
Primary DNS server is 10.2.12.1
Interface GigaEthernet0.13 is up, line protocol is up
Internet address is 192.168.13.49/24
Broadcast address is 192.168.13.255
Address determined by DHCP
Primary DNS server is 192.168.13.1
Interface Null0.0 is up, line protocol is up
Interface is unnumbered.
|
NAT 性能 ¶
Ubuntu 22.04 設定例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| # This is the network config written by 'subiquity'
network:
ethernets:
enp3s0:
dhcp4: false
enp2s0:
dhcp4: false
enx00X04X0X1X0X:
dhcp4: false
addresses:
- 10.2.21.23/24
vlans:
vlan.211:
id: 211
link: enp3s0
addresses:
- 192.0.2.1/24
vlan.221:
id: 221
link: enp2s0
dhcp4: true
vrfs:
vrf-wan:
table: 10
interfaces:
- vlan.211
version: 2
|