Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Created April 13, 2014 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruzickap/10592761 to your computer and use it in GitHub Desktop.
Save ruzickap/10592761 to your computer and use it in GitHub Desktop.
OpenWrt system and firewall changes
#Configure ssh key autologin:
ssh-copy-id -i ~/.ssh/id_rsa root@192.168.1.1
uci set system.@system[0].hostname=gate
uci add_list sshd.@openssh[0].Port=2222
uci add firewall rule
uci set firewall.@rule[-1].name=ssh
uci set firewall.@rule[-1].src=wan
uci set firewall.@rule[-1].target=ACCEPT
uci set firewall.@rule[-1].proto=tcp
uci set firewall.@rule[-1].dest_port=2222
uci add firewall redirect
uci set firewall.@redirect[-1].name=ssh_lan
uci set firewall.@redirect[-1].src=lan
uci set firewall.@redirect[-1].proto=tcp
uci set firewall.@redirect[-1].src_dport=22
uci set firewall.@redirect[-1].dest_port=2222
uci set firewall.@redirect[-1].dest_ip=192.168.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment