Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dante-sever fail to bind ip by interface name in docker container

Tags:

docker

bind

I try the docker recently, but the dante-server seem not to work.

Environment

os: gentoo x86_64
docker version:

Client version: 1.1.0
Client API version: 1.13
Go version (client): go1.3
Git commit (client): 79812e3
Server version: 1.1.0
Server API version: 1.13
Go version (server): go1.3
Git commit (server): 79812000

DockerFile for customized image

From centos:centos6

RUN yum install -y curl

RUN rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
RUN rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt


RUN echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/6/\$basearch/\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/nginx.repo

RUN yum install -y nginx tinyproxy dante-server mysql-server

start container

sudo docker run -i \
  --name="proxy" \
  -p 14000:3128 \
  -p 14001:4655 \
  -v ${confdir}/tinyproxy.conf:/etc/tinyproxy.conf \
  -v ${confdir}/dante-server.conf:/etc/sockd.conf \
  -v ${dantelogdir}:/var/log/socks \
  -v ${tinylogdir}:/var/log/tinyproxy \
  devel/centos6 /bin/bash -c "tinyproxy -c /etc/tinyproxy.conf;sockd -f /etc/sockd.conf"

sockd configuration

internal: eth0 port = 4655
external: eth0

logoutput: /var/log/socks/sockd.log
socksmethod: none

user.privileged: root
user.notprivileged: root
user.libwrap: root

client pass {
    from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
    clientmethod: none # match all idented users that also are in passwordfile
}

socks pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
  socksmethod: none
}

The tinyproxy works well when i test it alone. The dante-server passes the configuration test, but log follow errors during the initiation:

Aug 10 07:54:35 (1407653675.105641) sockd[12]: warning: bindinternal(): bind of address fe80::dc6f:d7ff:fe8f:fa59.46 55 (address #2/2) for server to listen on failed: Cannot assign requested address Aug 10 07:54:35 (1407653675.105650) sockd[12]: error: serverinit(): failed to bind internal addresses: Cannot assign requested address
Aug 10 07:54:35 (1407653675.105672) sockd[12]: alert: mother[1/1]: shutting down

The erros seems that dante-server can not bind to the ip resolved by the interface name **eth0*. Any help?

like image 650
Mr. C Avatar asked Oct 31 '25 07:10

Mr. C


1 Answers

Instead of internal: eth0 port = 4655 use internal: 0.0.0.0 port = 4655

like image 121
Michael Avatar answered Nov 02 '25 22:11

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!