Code Monkey home page Code Monkey logo

wc3-lan-relay's Introduction

WC3-LAN-Relay is a tool to relay Warcraft III traffic between networks.

Config

Server

{
  "Bind": "1.2.3.4:7112", // Where should the server listen to forwarded traffic
  "Client": "5.6.7.8:7112", // Where should the server forward traffic to
  "NATSourcePortStart": 10000, // UDP ports for NAT
  "NATSourcePortEnd": 30000, // For example, UDP ports 10000-30000 will be used for NAT. Including port 30000.
  "Role": 0, // Server
  "Servers": [],
  "WC3Interface": "eth1", // Interface where Warcraft III traffic will be monitored
  "PCAPInterface": "eth1", // Should be same as WC3Interface on Linux. On Windows, you have to find the interface's identifier
  "WC3InterfaceIPIndex": 0 // Select which IP is used as the source IP on WC3Interface, or set to -1 for auto detection
}

Client

{
  "Bind": "5.6.7.8:7112", // Where should the client listen to forwarded traffic
  "Client": "", // For servers only, ignored
  "NATSourcePortStart": 10000, // For servers only, ignored
  "NATSourcePortEnd": 30000, // For servers only, ignored
  "Role": 1, // Client
  "Servers": [
    {
      "DisplayName": "NET01", // Game name will be prefixed with the display name
      "Remote": "1.2.3.4:7112", // Endpoint of the server
      "LocalNetwork": "172.16.251.0/24" // Source IPs of the remote network will be mapped to here
    },
    {
      "DisplayName": "NET02",
      "Remote": "1.2.3.5:7112",
      "LocalNetwork": "172.16.252.0/24"
    }
  ],
  "WC3Interface": "tap0", // Interface where Warcraft III traffic will be monitored
  "PCAPInterface": "tap0", // Should be same as WC3Interface on Linux. On Windows, you have to find the interface's identifier
  "WC3InterfaceIPIndex": 0 // Select which IP is used as the source IP on WC3Interface, or set to -1 for auto detection
}

Setup

Server

# Drop TCP RST
iptables -I OUTPUT -p tcp --tcp-flags ALL RST,ACK -j DROP
iptables -I OUTPUT -p tcp --tcp-flags ALL RST -j DROP

go run .

Client

# Bind the network (AnyIP)
ip -4 route add local 172.16.251.0/24 dev lo
ip -4 route add local 172.16.252.0/24 dev lo

# Drop TCP RST
iptables -I OUTPUT -p tcp --tcp-flags ALL RST,ACK -j DROP
iptables -I OUTPUT -p tcp --tcp-flags ALL RST -j DROP

go run .

FAQ

TCP traffic is not going through

Ensure all the relay servers (including servers and clients) are not sending TCP RST packets.

On Windows, enable Windows Firewall.

On Linux, you might find these iptables rules useful.

iptables -I OUTPUT -p tcp --tcp-flags ALL RST -j DROP
iptables -I OUTPUT -p tcp --tcp-flags ALL RST,ACK -j DROP

Wrong IP being used as the source address

Try changing the WC3InterfaceIPIndex option.

Error PacketSendPacket

Turn off all fragmentation offload features. On Linux, you could use ethtool.

wc3-lan-relay's People

Contributors

slyh2 avatar

Watchers

Sam Leung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.