Skip to content
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

Switch only have connections to IP addresses, not domains #9

Closed
Ostrichbeta opened this issue May 24, 2024 · 2 comments
Closed

Switch only have connections to IP addresses, not domains #9

Ostrichbeta opened this issue May 24, 2024 · 2 comments

Comments

@Ostrichbeta
Copy link

I use my Mac as go-pcap2socks client and have my Switch connected to it, but I found out switch will only request IP addresses, instead of domains.
This is the logs of go-pcap2socks:

2024/05/23 16:16:18 INFO [UDP] Connection closed source=172.24.114.2:56632 dest=35.74.126.33:33334
2024/05/23 16:16:18 INFO [UDP] Connection source=172.24.114.2:32667 dest=8.8.8.8:53
2024/05/23 16:16:18 INFO [UDP] Connection source=172.24.114.2:26106 dest=104.198.251.169:34343
2024/05/23 16:16:18 INFO [TCP] Connection source=172.24.114.2:49547 dest=54.144.191.108:443
2024/05/23 16:16:22 INFO [TCP] Connection source=172.24.114.2:21141 dest=54.144.191.108:443
2024/05/23 16:16:27 INFO [UDP] Connection source=172.24.114.2:36339 dest=8.8.8.8:53
2024/05/23 16:16:29 INFO [UDP] Connection source=172.24.114.2:56449 dest=8.8.8.8:53
2024/05/23 16:16:30 INFO [UDP] Connection source=172.24.114.2:65101 dest=35.74.126.33:33334
2024/05/23 16:16:30 INFO [UDP] Connection source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:53744 dest=[::]:52940 error="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:36339 dest=[::]:58752 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:36339 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:13691 dest=[::]:49304 error="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:56449 dest=[::]:53312 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:56449 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:32667 dest=[::]:54509 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:32667 dest=8.8.8.8:53
2024/05/23 16:22:08 ERROR udp read packet error:  !BADKEY="io: read/write on closed pipe"
2024/05/23 16:22:08 WARN [UDP] pipe closed source=172.24.114.2:26106 dest=[::]:63154 error="io: read/write on closed pipe"
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:26106 dest=104.198.251.169:34343
2024/05/23 16:22:08 INFO [UDP] Connection closed source=172.24.114.2:53744 dest=35.74.126.33:33334
2024/05/23 16:22:08 INFO [UDP] Connection source=172.24.114.2:42061 dest=8.8.8.8:53
2024/05/23 16:22:08 INFO [UDP] Connection source=172.24.114.2:13691 dest=104.198.251.169:34343
2024/05/23 16:22:09 INFO [TCP] Connection source=172.24.114.2:43158 dest=35.170.126.178:443

This is my config file I use:

{
  "pcap": {
    "network": "172.24.0.0/16",
    "localIP": "172.24.114.1"
  },
  "routing": {
    "rules": [
      {
        "outboundTag": "dir"
      }
    ]
  },
  "outbounds": [
    {
      "tag": "",
      "socks": {
        "address": "127.0.0.1:1078",
        "username": "",
        "password": ""
      }
    },
    {
      "tag": "dir",
      "direct": {}
    }
  ]
}

Network settings on Switch:

  • IP: 172.24.114.51
  • Subnet mask: 255.255.255.0
  • Gateway: 172.24.114.1
  • DNS: 8.8.8.8, 8.8.4.4
@DaniilSokolyuk
Copy link
Owner

DaniilSokolyuk commented May 24, 2024

requests are not made to domains, they are made to IP addresses, you specified DNS: 8.8.8.8, 8.8.4.4, they are used to resolve domain names to IP addresses on your console, if it doesn't work then your proxy (127.0.0.1:1078) can't access DNS

@DaniilSokolyuk
Copy link
Owner

DaniilSokolyuk commented Jun 15, 2024

try this config, for dns requests to go directly

  "pcap": {
    "network": "172.24.0.0/16",
    "localIP": "172.24.114.1"
  },
  "routing": {
    "rules": [
      {
        "dstPort": "53",
        "outboundTag": "dir"
      }
    ]
  },
  "outbounds": [
    {
      "tag": "",
      "socks": {
        "address": "127.0.0.1:1078",
        "username": "",
        "password": ""
      }
    },
    {
      "tag": "dir",
      "direct": {}
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants