하나의 호스트 이름을 통해서만 양말5 서버에 대한 액세스를 제한하는 방법은 무엇입니까?

하나의 호스트 이름을 통해서만 양말5 서버에 대한 액세스를 제한하는 방법은 무엇입니까?

나는단테 서버(양말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를 받아야 합니다.

  1. curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address서버를 입력 하고 수신된 IP 주소를 기억하세요.
  2. 수신된 IP와 일치하도록 파일 의 internal( external필요한 경우) 필드를 편집하십시오 .danted.conf
  3. 서버를 다시 시작하십시오.

이제 유동 IP에 아직 IPv6가 없다는 점을 제외하면 모든 것이 잘 작동합니다.

관련 정보