Setup procedure for OpenWRT routers used for video production rigs

TP-LINK TL-WDR4300

echo 'server=/lcl/192.168.221.1' > /etc/dnsmasq.conf
echo 'server=/10.in-addr.arpa/192.168.221.1' >> /etc/dnsmasq.conf
echo 'server=/168.192.in-addr.arpa/192.168.221.1' >> /etc/dnsmasq.conf
echo 'rebind-domain-ok=/lcl/' >> /etc/dnsmasq.conf

/etc/init.d/autossh disable

sed -i -e "s/option boguspriv '1'/option boguspriv '0'/g" /etc/config/dhcp
sed -i -e "s/option filterwin2k '0'/option filterwin2k '1'/g" /etc/config/dhcp
sed -i -e "s|option local '/lan/'|option local '/video1.lcl/'|g" /etc/config/dhcp
sed -i -e "s/option domain 'lan'/option domain 'video1.lcl'/g" /etc/config/dhcp

sed -i -e "s/option ipaddr '192.168.1.1'/option ipaddr '192.168.61.1'/g" /etc/config/network
sed -i -e "s/option proto 'dhcp'/option proto 'dhcp'\n\nconfig interface 'wwan'\n\toption proto 'dhcp'/g" /etc/config/network
sed -i -e "s/option proto 'dhcp'/option proto 'dhcp'\n\toption hostname 'video1-router'/g" /etc/config/network

sed -i -e "s/list   network\t\t'wan6'/list   network\t\t'wan6'\n\tlist   network\t\t'wwan'/g" /etc/config/firewall

echo >> /etc/config/firewall
echo >> /etc/config/firewall
echo '# Allow SSH from WAN' >> /etc/config/firewall
echo 'config rule' >> /etc/config/firewall
echo $'\toption name\t\tAllow-SSH-WAN' >> /etc/config/firewall
echo $'\toption src\t\twan' >> /etc/config/firewall
echo $'\toption dest_port\t22' >> /etc/config/firewall
echo $'\toption target\t\tACCEPT' >> /etc/config/firewall
echo $'\toption proto\t\ttcp' >> /etc/config/firewall
echo 'config redirect' >> /etc/config/firewall
echo $'\toption name\t\tRedirect-SSH-2222-WAN' >> /etc/config/firewall
echo $'\toption src\t\twan' >> /etc/config/firewall
echo $'\toption dest\t\tlan' >> /etc/config/firewall
echo $'\toption target\t\tDNAT' >> /etc/config/firewall
echo $'\toption proto\t\ttcp' >> /etc/config/firewall
echo $'\toption src_dport\t2222' >> /etc/config/firewall
echo $'\toption dest_port\t22' >> /etc/config/firewall
echo $'\toption dest_ip\t\t192.168.61.1' >> /etc/config/firewall

echo '192.168.61.1 video1-router router' >> /etc/hosts

sed -i -e "s/option hostname 'OpenWrt'/option hostname 'video1-router'/g" /etc/config/system
sed -i -e "s|option timezone 'UTC'|option zonename 'America/Chicago'\n\toption timezone 'CST6CDT,M3.2.0,M11.1.0'|g" /etc/config/system

# edit /etc/config/wireless
# radio0:
# channel auto
# remove comment and change disabled to 0
# network: wwan
# mode: sta
# ssid: mcp-2.4
# encryption: psk2
# key = *PASSWORD*
# radio1:
# remove "disabled 1" (and comment)
# set channels 36, 40, 44
# ssid video1
# option encryption psk2
# option key **PASSWORD**

# add appropriate contents to /etc/openvpn and set up /etc/config/openvpn

sed -i -e "s/\toption proto 'dhcpv6'/\toption proto 'dhcpv6'\n\nconfig interface 'vpn'\n\toption ifname 'tun0'\n\toption proto 'none'/g" /etc/config/network
sed -i -e "s/\toption ignore '1'/\toption ignore '1'\n\nconfig dhcp 'vpn'\n\toption interface 'vpn'\n\toption ignore '1'/g" /etc/config/dhcp
sed -i -e "s/\toption localservice '1'/\toption localservice '0'/g" /etc/config/dhcp

# duplicate "config zone" block from lan in /etc/config/firewall for vpn (change FORWARD to REJECT)
# duplicate "config forwarding" block in /etc/config/firewall to for src:vpn dest:lan and src:lan dest:vpn
computer/video_openwrt_router_setup.txt · Last modified: 2016/02/23 21:34 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS