kwaa / comet

🌠 Comet Gateway - 实验性 Naiveproxy 透明网关. [WIP]
Do What The F*ck You Want To Public License
11 stars 2 forks source link

0.0.0.0:53: bind: address already in use #3

Open chent1001 opened 5 months ago

chent1001 commented 5 months ago

sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/direct[dns-in]: listen tcp 0.0.0.0:53: bind: address already in use sing-box | FATAL[0000] start service: initialize inbound/tun[tun-in]: listen tcp6 [fd00::1]:0: bind: cannot assign requested add

Hello, I'm having trouble with the deployment. Port 53 is occupied.

kwaa commented 5 months ago

Are you running as root? or you may have other services running in the background that take up port 53, such as other DNS servers.

chent1001 commented 5 months ago

root@test149:~/naive/comet# lsof -i tcp:53 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME systemd-r 646 systemd-resolve 13u IPv4 21202 0t0 TCP localhost:domain (LISTEN)

kwaa commented 5 months ago

For this scenario, you may want to change the comet's DNS port to 5353.

https://github.com/kwaa/comet/blob/bada9a501f0a79395560a01c9a62dedc0cae2888/sing-box/config.json#L104

chent1001 commented 5 months ago

I turned off the firewall. The commands were not executed. iptables -t filter -A FORWARD -j ACCEPT iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE Now there's a timeout.

ERROR[0005] [3266690595 5.30s] inbound/tun[tun-in]: dial tcp 172.18.0.2:1080: i/o timeout sing-box | ERROR[0005] [4196403194 5.30s] inbound/tun[tun-in]: dial tcp 172.18.0.2:1080: i/o timeout

kwaa commented 5 months ago

If you are not using HAProxy, try setting the naive container to host mode.

remove this:

https://github.com/kwaa/comet/blob/bada9a501f0a79395560a01c9a62dedc0cae2888/docker-compose.yml#L37-L39

add this:

https://github.com/kwaa/comet/blob/bada9a501f0a79395560a01c9a62dedc0cae2888/docker-compose.yml#L9

I turned off the firewall.

comet requires iptables rules to make it accessible to other devices.

chent1001 commented 5 months ago

start service: initialize rule-set[1]: initial rule-set: geosite-geolocation-!cn: Get "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs": dial tcp 127.0.0.1:1080: connect: connection refused | initialize rule-set[1]: initial rule-set: geoip-cn: Get "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs": context canceled

I've done what you asked, but I'm still getting an error that the 1080 isn't being listened to.

chent1001 commented 5 months ago

This is the current configuration

` version: '3'

services:

sing-box: container_name: sing-box image: ghcr.io/sagernet/sing-box:latest restart: always network_mode: host privileged: true devices:

kwaa commented 5 months ago

Did you set the domain_keyword correctly?

https://github.com/kwaa/comet?tab=readme-ov-file#sing-boxconfigjson

Normally it should download the geoip / geosite files correctly.

kwaa commented 5 months ago

Maybe I need to update the configuration for the new version of sing-box