Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Make root file system writable:
- mount -o remount,rw /dev/ubi0 /
- # Install feature rich busybox
- curl --insecure https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv7l > /bin/busybox-v1.31.0-armv7l
- chmod +x /bin/busybox-v1.31.0-armv7l
- cd /bin
- ln -s busybox-v1.31.0-armv7l sysctl
- # Create sysctl.conf with modified parameters
- cat <<EOF > /etc/sysctl.conf
- net.ipv4.ip_local_port_range=15000 64000
- net.ipv4.tcp_fin_timeout=30
- net.ipv4.tcp_tw_recycle=1
- net.ipv4.tcp_tw_reuse=1
- net.core.somaxconn=1024
- net.netfilter.nf_conntrack_max=30000
- EOF
- # Apply parameters
- sysctl -p
- # Create script to apply parameters on startup
- cat <<'EOF' > /etc/init.d/increaselimits.sh
- #!/bin/sh
- case "$1" in
- start)
- echo "Increasing Connection Limits..."
- sysctl -p
- exit 0
- ;;
- stop)
- echo "Not implemented..."
- exit 1
- ;;
- *)
- echo "$0: unrecognized option $1"
- exit 1
- ;;
- esac
- EOF
- # Make script executable and create link in /etc/rc3.d
- chmod 755 /etc/init.d/increaselimits.sh
- cd /etc/rc3.d
- ln -s ../init.d/increaselimits.sh S99increaselimits
- # Make root filesystem read only
- mount -o remount,ro /dev/ubi0 /
Add Comment
Please, Sign In to add comment