![하나의 호스트 이름을 통해서만 양말5 서버에 대한 액세스를 제한하는 방법은 무엇입니까?](https://rvso.com/image/1558031/%ED%95%98%EB%82%98%EC%9D%98%20%ED%98%B8%EC%8A%A4%ED%8A%B8%20%EC%9D%B4%EB%A6%84%EC%9D%84%20%ED%86%B5%ED%95%B4%EC%84%9C%EB%A7%8C%20%EC%96%91%EB%A7%905%20%EC%84%9C%EB%B2%84%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%95%A1%EC%84%B8%EC%8A%A4%EB%A5%BC%20%EC%A0%9C%ED%95%9C%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
나는단테 서버(양말5 프록시) 이는 내 호스트 이름( ) 중 하나를 가리킵니다 sub.example.com
. 내 기본 구성은 다음과 같습니다(예제 변형으로 대체된 내 도메인).
logoutput: /var/log/danted.log
internal: sub.example.com port = 9000
external: sub.example.com
user.privileged: root
user.notprivileged: nobody
socksmethod: username
client pass {
from: 0/0 to: sub.example.com
log: error connect disconnect
}
socks pass {
from: 0/0 to: sub.example.com
command: bind connect udpassociate
log: error # connect disconnect
}
socks pass {
from: 0/0 to: sub.example.com
command: bindreply udpreply
log: error # connect disconnect
}
# Even blocked the main hostname, also tried ".example.com",
# with libwrap compiled and activated (and "hosts.access" too)
socks block {
from: 0/0 to: example.com
log: error connect disconnect
}
프록시 연결을 로만 제한하고 싶지만 sub.example.com
다른 하위 도메인 및 을 통해서만 연결할 수 있습니다 example.com
. 하나의 호스트 이름으로만 제한할 수 있습니까?
답변1
해결 방법을 찾았지만 이는 나쁜 습관입니다. 저는 DigitalOcean을 사용하고 있기 때문에 각 서버마다 유동 IP를 제공합니다. 이를 활성화하고 실제 유동 IP로 트래픽을 전달하는 몇 가지 작업을 수행했습니다.
이 기사에 따르면DigitalOcean에서 유동 IP를 사용하는 방법유동 IP로 작업을 수행하려면 먼저 로컬 IP를 받아야 합니다.
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address
서버를 입력 하고 수신된 IP 주소를 기억하세요.- 수신된 IP와 일치하도록 파일 의
internal
(external
필요한 경우) 필드를 편집하십시오 .danted.conf
- 서버를 다시 시작하십시오.
이제 유동 IP에 아직 IPv6가 없다는 점을 제외하면 모든 것이 잘 작동합니다.