目录

Step 1:Setup Your System Root

乌鱼翻墙软件2026-08-12180
Setting up OpenWrt for scientific上网 involves several steps to ensure you have a smooth and secure environment. Below is a step-by-step guide to help you get started: Uninsta...

Setting up OpenWrt for scientific上网 involves several steps to ensure you have a smooth and secure environment. Below is a step-by-step guide to help you get started:

  1. Uninstall System Software:

    • Remove any unnecessary system software or services to prevent conflicts.
    • Remove 杀file, modprobe, and any other unnecessary utilities.
  2. Install System Root:

    • Use a package manager (e.g., sudo apt install system-root on Ubuntu/Debian, or sudo revcat on Fedora/RedHat).
    • This creates a root user (root) with full system access.
  3. Disable System Services:

    • Stop services that are not needed (e.g., sudo service stop all).
  4. Install Required Software:

    • Install apt (for Debian/Ubuntu-based systems) or yum (for CentOS/RHEL).
    • Ensure your system has sudo and sudo systemctl commands.

Step 2: Install and Configure OpenWrt

  1. Install OpenWrt:

  2. Install Dependencies:

    • Open OpenWrt and go to sudo systemctl install.
    • Install required packages like libsh2-1, libsh2-ai, libsh2-base, and libsh2-open.
    • Install sudo-ntfs for NTFS file system setup.
  3. Install Firewall:

    • Install iptables with:
      sudo iptables -t user -u net -j drop -j 999,1
    • Install a custom firewall for security:
      sudo iptables -t user -u net -j basic -a match -o net -
      sudo iptables -t user -u net -j basic -a match -o net -i 192.168.1.1/255.255.255.
      sudo iptables -t user -u net -j basic -a match -o net -i 192.168.1.1/255.255.255.
      sudo iptables -t user -u net -j basic -a match -o net -i 192.168.1.1/255.255.255.
      sudo iptables -t user -u net -j basic -a match -o net -i 192.168.1.1/255.255.255.
      sudo iptables -t user -u net -j basic -a match -o net -i 192.168.1.1/255.255.255.

Step 3: Set Up User Directory

  1. Create Root User:

    • In the OpenWrt root user directory (/user/) create a user named root:
      sudo user add -m root
    • Add another user (e.g., userdev devroot) with sudo user add -m devroot.
  2. Configure Role System:

    • Set root as the primary user:
      sudo user setrole root
    • Set root as the default role for development:
      sudo user setrole devroot
  3. Set Up Development User:

    • Create a development user if needed:
      sudo user add -m developmentroot

Step 4: Configure the Development Kernel

  1. Add Development Kernel:

    • Add the development kernel to the system:
      sudo system add dev
  2. Configure Development Kernel Rules:

    • Add a rule to allow editing files:
      sudo system add rule editfile
    • Add a rule to allow creating directories:
      sudo system add rule dir
  3. Install Development Scripts:

    • Install the development scripts in /var/lib/:
      sudo add-args sudo cd /var/lib && ls

Step 5: Set Up Firewalls and Security

  1. Add Firewall Rules:

    • Add basic firewall rules to restrict certain actions:
      sudo firewall add -i 8 -o 443 -d 256
      sudo firewall add -i 8 -o 443 -d 256 -e 2
    • Add custom firewall rules based on your security needs.
  2. Install Custom Firewall:

    Follow the instructions to set up a custom firewall for specific security requirements.


Step 6: Update the System

  1. Back Up Data:

    Before starting, backup your data to avoid loss if something goes wrong.

  2. Update System Kernel:

    • Update the system:
      sudo system update
  3. Update Package Lists:

    • Update the package list:
      sudo apt update
  4. Reboot OpenWrt:

    • After updating, reboot OpenWrt to apply changes:
      sudo reboot

Step 7: Set Up System Boot

  1. Enable System Boot:

    • Ensure the system has the ability to boot from the hard drive:
      sudo system boot enable
  2. Configure System Boot:

    • Set up the system to boot the root user:
      sudo system boot -b root
    • Set up the development kernel to boot the development user:
      sudo system boot -b dev
  3. Install System Boot Scripts:

    • Install the system boot scripts in the root user directory:
      sudo add-args sudo cd /var/lib && ls
    • Add the following scripts:
      sudo script install root -name systemboot -args root -cmd /bin/sh -c /bin/sh -l -s 128 -n "OpenWrt -B"
      sudo script install dev -name systemboot-dev -args dev -cmd /bin/sh -c /bin/sh -l -s 128 -n "OpenWrt -B"

Step 8: Test the System

  1. Check User Access:

    • Verify that the root user has access to all system files and scripts:
      sudo ls /var/log/auth
  2. Firewall Testing:

    • Test the firewall rules to ensure they restrict unauthorized access:
      sudo firewall test
  3. System Boot Test:

    • Test the system boot to ensure it starts correctly:
      sudo system boot test

Step 9: Troubleshooting

  1. Check Permissions:

    • If you're accessing restricted files, check permissions:
      sudo ls -l /path/to/file
    • Use sudo ls -l to see restricted files.
  2. Check Firewall Rules:

    • If you're being blocked by a firewall, check rules:
      sudo iptables -t global -A rule -a -s -o net/.1.1.1/255.255.255. -m 0
  3. Check System Boot Issues:

    • If the system isn't booting, check the boot process:
      sudo ls -l /dev/sdX
    • Check the boot script files:
      sudo ls -l /var/lib/systems/root boot script

Step 1: What to Expect When You Start Using OpenWrt for Science

  • Secure Environment: OpenWrt provides strong security, making it suitable for scientific work.
  • Extensive Configuration: You can customize OpenWrt to meet your specific needs.
  • Extensive Package List: OpenWrt offers a wide range of tools and scripts for various tasks.

By following these steps, you should be able to set up and use OpenWrt for scientific上网 effectively. Have a great day!

Step 1:Setup Your System Root

扫描二维码推送至手机访问。

本文转载自互联网,如有侵权,联系删除。

本文链接:https://kuailianapp-m.com.cn/post/5278.html

扫描二维码手机访问

文章目录
网站地图