-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to bind traefik to a single IP address. #4107
Comments
Hello @plamer, Looking at the logs you provided:
That does not match with the configuration you provided:
The address it is trying to bind to in your logs is all addresses on port 443, which is why you are getting the error. Can you confirm that you provided the correct toml, and that you are not using any configuration via command line (such as compose arguments)? Thanks! |
Hey @dtomcej, yes, that's correct - I'm starting traefik with only a config file (added the debug flag when creating the issue) as an argument:
While searching for this I found this issue: #1193 but nothing else. |
@plamer I have tried to recreate your issue, but with no avail. I have added 2 IPs to my machine: 10.0.0.100, and 192.168.1.105. I have created 2 toml files: defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = "10.0.0.100:80" and defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = "192.168.1.105:80" When I run: ./traefik -c test1.toml &
./traefik The first binds to the proper IP, and then the second binds to all available remaining ports: $ sudo lsof -i -n -P | grep TCP | grep :80 | grep LISTEN
traefik 6124 root 5u IPv4 0x171888116e7d11e9 0t0 TCP 10.0.0.100:80 (LISTEN)
traefik 6139 root 5u IPv6 0x17188811852b9ae9 0t0 TCP *:80 (LISTEN) When I run:
They bind to the respective ports: $ sudo lsof -i -n -P | grep TCP | grep :80 | grep LISTEN
traefik 6124 root 5u IPv4 0x171888116e7d11e9 0t0 TCP 10.0.0.100:80 (LISTEN)
traefik 6155 root 5u IPv4 0x17188811721f54e9 0t0 TCP 192.168.1.105:80 (LISTEN) The only way I get a conflict like you are explaining, is when I run two instances of traefik without the config file at all (both try to bind to all ports 80): $ sudo ./traefik
FATA[2018-10-29T12:07:57-05:00] Error preparing server: error opening listener: listen tcp :80: bind: address already in use Note that the listener address is The same happens if I duplicate a config: $ sudo ./traefik -c dist/test3.toml
FATA[2018-10-29T12:09:09-05:00] Error preparing server: error opening listener: listen tcp 10.0.0.100:80: bind: address already in use The address attempting to bind is listed in the error message. In your logs your listener is logging as Are you running the traefik binary? Can you provide the command you are using to run traefik? I feel that something is missing that is causing your conflict. Thanks! |
@dtomcej thanks for testing this - I'm sorry I wasted your time. It appears that if you want to change the listening address you have to clear some (?) key in the etcd store - when I tried running it with a specific address it still started listening on all IPs and after stopping, doing My apologies again for not trying that in the first place. |
No worries, I will go ahead and close this ticket then :) Please feel free to reach out to us on slack if you encounter more issues. |
Do you want to request a feature or report a bug?
bug
What did you do?
I have a server with two public IPs:
XX.XX.XX.200
- ports 80/443/8080 are free - nothing is listening thereXX.XX.XX.247
- nginx listening on the IP address (not 0.0.0.0)I'm trying to start traefik only on
XX.XX.XX.200
IP:What did you expect to see?
Traefik running on
XX.XX.XX.200:80
,XX.XX.XX.200:443
What did you see instead?
Output of
traefik version
: (What version of Traefik are you using?)What is your environment & configuration (arguments, toml, provider, platform, ...)?
The text was updated successfully, but these errors were encountered: