Difference between revisions of "Openwrt"

From Steak Wiki
Jump to navigationJump to search
Line 47: Line 47:
 
<pre>export TERM=xterm
 
<pre>export TERM=xterm
 
alias vpnme= 'openvpn --config /etc/openvpn/myconfigfile.ovpn & ./script.sh &'</pre>
 
alias vpnme= 'openvpn --config /etc/openvpn/myconfigfile.ovpn & ./script.sh &'</pre>
 +
 +
===various links i found interesting===
 +
 +
* https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm - speed test, and traffic shaping to speed up a 'slow' network. protip: use x86 instead of arm if openwrt is slow.
 +
 +
* https://openwrt.org/docs/guide-user/services/nas/netatalk_configuration apple time machine backup server

Revision as of 16:52, 27 August 2020

Tips

port forwarding

Port forwarding is two steps:

  1. redirect port from outside to internal (NAT)
  2. allow access from outside to inside via this port (firewall)

Contents of /etc/config/firewall

config redirect option name 'PassthroughformyServer' option src 'wan' option proto 'tcp' option src_dport '80' option dest_ip '192.168.1.100' option dest_port '80' option target 'DNAT' option dest 'lan' config rule option src 'wan' option proto 'tcp' option dest_port '80' option target 'ACCEPT'

Note: Proto can be 'tcp' OR 'tcpudp' OR 'udp'

reserved ip / static lease

Contents of /etc/config/dhcp

config host option ip 192.168.1.122 option mac c2:44:32:18:cd:ab option name reservedipcomputer

ref: https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#static_leases

I tried to add this to the wiki, but someone (https://openwrt.org/docs/guide-user/base-system/dhcp_configuration?rev=1596434574) decided to replace my simple solution with an obfuscated one that requires uci commands. So instead, it will remain here. EDIT: I added it back. See how long that lasts...

openvpn

opkg install openvpn-openssl

Contents of /etc/config/openvpn

config openvpn 'custom_config' option config '/etc/openvpn/myconfigfile.ovpn'

And your .ovpn in /etc/openvpn/.

aliases

Put in /etc/profile. e.g.

export TERM=xterm
alias vpnme= 'openvpn --config /etc/openvpn/myconfigfile.ovpn & ./script.sh &'

various links i found interesting