Add platform infrastructure configuration
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# 호스트 Split DNS
|
||||
|
||||
두 dnsmasq 프로세스가 서로 다른 주소에만 바인딩됩니다.
|
||||
|
||||
- LAN: 192.168.0.107:53
|
||||
- Tailscale: 100.92.240.34:53
|
||||
|
||||
공유기 DHCP DNS에는 192.168.0.107을 지정하고, Tailscale 관리 화면에는
|
||||
learn.hyeonworks.com 제한 nameserver로 100.92.240.34를 등록합니다.
|
||||
이 두 관리 화면 변경은 자동화하지 않습니다.
|
||||
|
||||
현재 gateway `192.168.0.1`의 MAC OUI와 관리 페이지는 TP-Link 계열이다.
|
||||
dnsmasq 실제 적용이 성공한 뒤 다음 순서로 설정한다.
|
||||
|
||||
## TP-Link LAN
|
||||
|
||||
1. LAN 단말에서 http://192.168.0.1/ 에 로그인한다.
|
||||
2. `Advanced > Network > DHCP Server`에 DNS 필드가 있으면 Primary DNS를
|
||||
`192.168.0.107`로 지정하고 Secondary DNS는 비워 둔다.
|
||||
3. 해당 메뉴에 DNS 필드가 없으면 `Advanced > Network > Internet`에서
|
||||
`Use the following DNS addresses`를 선택하고 Primary DNS를
|
||||
`192.168.0.107`로 지정한다.
|
||||
4. 저장한 뒤 공유기를 재부팅하고 단말의 Wi-Fi를 다시 연결해 DHCP lease를
|
||||
갱신한다.
|
||||
|
||||
공개 DNS를 Secondary에 넣으면 단말이 private resolver를 우회할 수 있으므로
|
||||
사용하지 않는다. 정확한 메뉴는 TP-Link firmware에 따라 둘 중 하나다.
|
||||
|
||||
## Tailscale
|
||||
|
||||
1. https://login.tailscale.com/admin/dns 에 로그인한다.
|
||||
2. `Nameservers > Add nameserver > Custom`을 선택한다.
|
||||
3. nameserver에 `100.92.240.34`를 입력한다.
|
||||
4. `Restrict to search domain`을 켜고 `learn.hyeonworks.com`을 입력해 저장한다.
|
||||
5. 단말에서 Tailscale DNS 수락을 켜고 다시 연결한다.
|
||||
|
||||
검증:
|
||||
|
||||
nslookup git.learn.hyeonworks.com
|
||||
nslookup id.learn.hyeonworks.com
|
||||
nslookup storage-admin.learn.hyeonworks.com
|
||||
nslookup db-admin.learn.hyeonworks.com
|
||||
nslookup grafana.learn.hyeonworks.com
|
||||
|
||||
LAN에서는 다섯 이름이 `192.168.0.107`, Tailscale 경로에서는
|
||||
`100.92.240.34`로 응답해야 한다.
|
||||
|
||||
공식 참고:
|
||||
|
||||
- TP-Link DNS 설정: https://www.tp-link.com/ca/support/faq/1712/
|
||||
- Tailscale split DNS: https://tailscale.com/learn/why-split-dns
|
||||
|
||||
공개 DNS에는 storage-admin, db-admin, grafana A/AAAA 레코드를 만들지 않습니다.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Hyeonworks LAN 전용 dnsmasq 인스턴스
|
||||
port=53
|
||||
listen-address=192.168.0.107
|
||||
bind-interfaces
|
||||
no-hosts
|
||||
no-resolv
|
||||
server=1.1.1.1
|
||||
server=1.0.0.1
|
||||
cache-size=1000
|
||||
domain-needed
|
||||
bogus-priv
|
||||
address=/git.learn.hyeonworks.com/192.168.0.107
|
||||
address=/id.learn.hyeonworks.com/192.168.0.107
|
||||
address=/storage-admin.learn.hyeonworks.com/192.168.0.107
|
||||
address=/db-admin.learn.hyeonworks.com/192.168.0.107
|
||||
address=/grafana.learn.hyeonworks.com/192.168.0.107
|
||||
@@ -0,0 +1,16 @@
|
||||
# Hyeonworks Tailscale 전용 dnsmasq 인스턴스
|
||||
port=53
|
||||
listen-address=100.92.240.34
|
||||
bind-interfaces
|
||||
no-hosts
|
||||
no-resolv
|
||||
server=1.1.1.1
|
||||
server=1.0.0.1
|
||||
cache-size=1000
|
||||
domain-needed
|
||||
bogus-priv
|
||||
address=/git.learn.hyeonworks.com/100.92.240.34
|
||||
address=/id.learn.hyeonworks.com/100.92.240.34
|
||||
address=/storage-admin.learn.hyeonworks.com/100.92.240.34
|
||||
address=/db-admin.learn.hyeonworks.com/100.92.240.34
|
||||
address=/grafana.learn.hyeonworks.com/100.92.240.34
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Hyeonworks LAN private DNS
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/dnsmasq --keep-in-foreground --user=dnsmasq --group=nogroup --conf-file=/etc/dnsmasq-hyeonworks/lan.conf --pid-file=/run/hyeonworks-dnsmasq-lan.pid
|
||||
Restart=on-failure
|
||||
RestartSec=2s
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectHome=true
|
||||
ProtectSystem=strict
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectControlGroups=true
|
||||
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Hyeonworks Tailscale private DNS
|
||||
After=network-online.target tailscaled.service
|
||||
Wants=network-online.target tailscaled.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/dnsmasq --keep-in-foreground --user=dnsmasq --group=nogroup --conf-file=/etc/dnsmasq-hyeonworks/tailscale.conf --pid-file=/run/hyeonworks-dnsmasq-tailscale.pid
|
||||
Restart=on-failure
|
||||
RestartSec=2s
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectHome=true
|
||||
ProtectSystem=strict
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectControlGroups=true
|
||||
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user