λ°μν
Intro
μλ νμΈμ. μ΄λ² μκ°μλ AWS IP λμμ νμΈνλ λ°©λ²μ λν΄ μμ보λλ‘ νκ² μ΅λλ€.
AWS IP λμ
AWS λ IP λμμ json ννλ‘ μ 곡νκ³ μμ΅λλ€. (https://ip-ranges.amazonaws.com/ip-ranges.json)
{
"syncToken": "1675316588",
"createDate": "2023-02-02-05-43-08",
"prefixes": [
{
"ip_prefix": "3.2.34.0/26",
"region": "af-south-1",
"service": "AMAZON",
"network_border_group": "af-south-1"
},
{
"ip_prefix": "3.5.140.0/22",
"region": "ap-northeast-2",
"service": "AMAZON",
"network_border_group": "ap-northeast-2"
},
{
"ip_prefix": "13.34.37.64/27",
"region": "ap-southeast-4",
"service": "AMAZON",
"network_border_group": "ap-southeast-4"
},
...
}
Seoul Region AWS
νμ§λ§ ν΄λΉ jsonμλ λ§€μ° λ§μ region IPκ° μ‘΄μ¬νκ³ μμ΅λλ€. μ΄ μ€μμ μμΈ λ¦¬μ μ EC2 IP λμμ μΆμΆνκ³ μΆμ λλ μλμ λͺ λ Ήμ΄λ₯Ό μ¬μ©νλ©΄ λ©λλ€ .
β ~ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.region=="ap-northeast-2") | select(.service=="EC2") | .ip_prefix'
3.5.140.0/22
151.148.40.0/24
15.177.76.0/24
43.200.0.0/14
3.36.0.0/14
3.2.37.0/26
54.180.0.0/15
52.79.0.0/16
13.125.0.0/16
15.193.9.0/24
35.71.109.0/24
52.94.248.176/28
13.124.0.0/16
99.77.141.0/24
3.5.144.0/23
13.209.0.0/16
52.78.0.0/16
99.77.242.0/24
99.150.24.0/21
52.95.252.0/24
15.164.0.0/15
3.34.0.0/15
99.151.144.0/21
λ°μν