Blogger Avatar

人間になりたい!!!!!


皖ICP备2025096275号

Accessing the Internet in Different Network Environments? -- Setting Up Shadowsocks Nodes

Preface

After entering university, I found that some campus websites can only be accessed when using the campus network. However, when at home or outside campus, it's impossible to directly connect to the campus network. This article will teach you how to use the Shadowsocks tool to proxy network traffic, enabling access to websites in different network environments.

Use Cases

  • Accessing campus network from outside
  • Accessing corporate intranet from outside
  • Operations personnel accessing machine room intranet from outside

Legal Disclaimer

  • Strictly prohibit using the tools and methods provided in this article for illegal activities such as bypassing internet censorship. Consequences are at your own risk!
  • This tutorial and its author are not responsible for any readers who engage in illegal activities

Configuration Requirements

  • Linux server
  • Brain

    This tutorial is based on servers with public IP addresses. If your peer device does not have a public IP, you can also refer to this tutorial to configure a private network.

    Let's Get Started

    This tutorial will use Debian-based distributions as examples

    Server Configuration

  • Install Shadowsocks and its dependencies using apt

    sudo apt install -y build-essential autoconf libtool libssl-dev libpcre3-dev libc-ares-dev libev-dev asciidoc xmlto automake
    
    sudo apt install -y software-properties-common
    sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
    sudo apt update
    sudo apt install -y shadowsocks-libev
    Installation requires approximately 3 ~ 4GB of storage space
  • Open the Shadowsocks configuration file

    nano /etc/shadowsocks-libev/config.json
  • Fill in the configuration according to this template

    {
      "server":["::", "0.0.0.0"],
      "mode":"tcp_and_udp",
      "server_port":<Your server port>,
      "local_port":1080,
      "password":"<Your password>",
      "timeout":86400,
      "method":"chacha20-ietf-poly1305"
    }
    • Adding "no-delay":true can disable the Nagle algorithm to reduce latency
    • "server":["::","0.0.0.0"] can listen on both IPv4 and IPv6 simultaneously. If you don't want to listen on IPv6, you can change it to "server":"0.0.0.0"
    • Additionally, here are some advanced parameters you can choose:

      • nameserver: Add specified DNS server address
      • ipv6_first: Whether to prioritize IPv6
      • workers: Number of worker threads. Generally set to the number of CPU cores
      • mtu: Maximum transmission unit. When proxy performance is poor, you can try reducing this value
  • After saving the configuration, add Shadowsocks to startup and start the program

    sudo systemctl start shadowsocks-libev
    sudo systemctl enable shadowsocks-libev
  • After starting, you can check if it's running normally by viewing the program logs

    sudo systemctl status shadowsocks-libev

    Normal running logs are as follows:

    ● shadowsocks-libev.service - Shadowsocks-libev Default Server Service
         Loaded: loaded (/lib/systemd/system/shadowsocks-libev.service; enabled; preset: enabled)
         Active: active (running) since Thu 2026-01-29 10:29:21 EST; 18s ago
           Docs: man:shadowsocks-libev(8)
       Main PID: 927631 (ss-server)
          Tasks: 1 (limit: 1138)
         Memory: 2.9M
            CPU: 37ms
         CGroup: /system.slice/shadowsocks-libev.service
                 └─927631 /usr/bin/ss-server -c /etc/shadowsocks-libev/config.json
    
    Jan 29 10:29:21 ACCK-HK systemd[1]: Started shadowsocks-libev.service - Shadowsocks-libev Default Server Service.
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: UDP relay enabled
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: enable TCP no-delay
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: initializing ciphers... <Data Deleted>
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: tcp server listening at [::]:<Data Deleted>
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: tcp server listening at 0.0.0.0:<Data Deleted>
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: udp server listening at [::]:<Data Deleted>
    Jan 29 10:29:21 ACCK-HK ss-server[927631]:  2026-01-29 10:29:21 INFO: udp server listening at 0.0.0.0:<Data Deleted>
  • If your program runs normally without errors, the server configuration is now complete

Client Configuration

There are many client options for Shadowsocks, which are not convenient to display on this site, but some external tutorials can be provided for readers to reference:


Conclusion

Thank you for reading. If you find any errors, please feel free to point them out!

Accessing the Internet in Different Network Environments? -- Setting Up Shadowsocks Nodes
https://blog.nanami.tech/en/archives/228/
Author Madobi Nanami
Publish Time 2026-01-29
License CC BY-NC-SA 4.0
Post a new comment