OpenWrt/TP-Link TL-MR3020: Difference between revisions

From Wiki
(Die Seite wurde neu angelegt: „/config/network <blockquote> <pre> config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0…“)
 
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
/config/network
== /config/network ==
<blockquote>
<blockquote>
<pre>
<pre>
Line 9: Line 9:


config interface 'lan'
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option proto 'static'
option ipaddr '192.168.111.20'
option ipaddr '192.168.111.20'
Line 19: Line 17:
</blockquote>
</blockquote>


/config/dhcp
== /config/firewall ==
<blockquote>
<blockquote>
<pre>
<pre>
config dnsmasq
config defaults
option domainneeded 1
option input 'ACCEPT'
option boguspriv 1
option output 'ACCEPT'
option filterwin2k 0  # enable for dial on demand
option forward 'ACCEPT'
option localise_queries 1
option disable_ipv6 '1'
option rebind_protection 1  # disable if upstream must serve RFC1918 addresses
 
option rebind_localhost 1  # enable for RBL checking and similar services
config zone
#list rebind_domain example.lan # whitelist RFC1918 responses for domains
option name 'lan'
option local '/lan/'
option input 'ACCEPT'
option domain 'lan'
option output 'ACCEPT'
option expandhosts 1
option forward 'ACCEPT'
option nonegcache 0
option network 'lan'
option authoritative 1
 
option readethers 1
config zone
option leasefile '/tmp/dhcp.leases'
option name 'wan'
option resolvfile '/tmp/resolv.conf.auto'
option input 'ACCEPT'
#list server '/mycompany.local/1.2.3.4'
option output 'ACCEPT'
#option nonwildcard 1
option forward 'ACCEPT'
#list interface br-lan
option network 'wifi'
#list notinterface lo
 
#list bogusnxdomain    '64.94.110.11'
config rule
option src 'wan'
option proto 'tcp'
option dest_port 'ssh'
option target 'ACCEPT'
 
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
 
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
 
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fe80::/10'
option src_port '547'
option dest_ip 'fe80::/10'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
 
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
 
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
 
config include
option path '/etc/firewall.user'
 
config forwarding
option dest 'lan'
option src 'wan'
 
config forwarding
option dest 'wan'
option src 'lan'
 
</pre>
</blockquote>
 
 
== /config/fstab ==
<blockquote>
<pre>
config global automount
option from_fstab 1
option anon_mount 1
config global autoswap
option from_fstab 1
option anon_swap 0
config mount
option target /home
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 0
option enabled_fsck 0


config dhcp lan
config swap
option interface lan
option device /dev/sda2
option ignore 1
option enabled 0
option start 100
option limit 150
option leasetime 12h


config dhcp wan
option interface wan
option ignore 1
</pre>
</pre>
</blockquote>
</blockquote>


== /config/wireless ==
<blockquote>
<pre>
config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
option macaddr 'xx:xx:xx:xx:xx:xx'
option hwmode '11ng'
option htmode 'HT20'
list ht_capab 'SHORT-GI-20'
list ht_capab 'SHORT-GI-40'
list ht_capab 'RX-STBC1'
list ht_capab 'DSSS_CCK-40'
option txpower '27'
option country 'DE'
config wifi-iface
option device 'radio0'
option mode 'sta'
option ssid 'wifi'
option encryption 'psk2'
option key 'password'
option network 'lan'
</pre>
</blockquote>




Block Device (root from usb stick)
== /config/dhcp ==
<blockquote>
<blockquote>
<pre>
<pre>
opkg update
config dnsmasq
opkg install kmod-usb-uhci
option domainneeded '1'
insmod uhci
option boguspriv '1'
opkg install kmod-usb-ohci
option filterwin2k '0'
insmod usb-ohci
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
 
config dhcp 'lan'
option interface 'lan'
option ignore '1'
 
config dhcp 'wan'
option interface 'wan'
option ignore '1'
 
config dhcp
option start '100'
option leasetime '12h'
option limit '150'
option interface 'eth'
 
</pre>
</blockquote>
 


opkg install kmod-usb-storage block-mount kmod-fs-ext4 kmod-nls-cp437 kmod-nls-cp850 kmod-nls-iso8859-1 kmod-nls-iso8859-15 kmod-scsi-core e2fsprogs fdisk
== /etc/rc.local ==
<blockquote>
<pre>
alsactl -f /etc/asound.state restore
/etc/scripts/madplay_stream.sh &
exit 0
</pre>
</pre>
</blockquote>
</blockquote>




USB-Sound
 
== USB-Sound ==
<blockquote>
<blockquote>
<pre>
<pre>
Line 81: Line 231:
</blockquote>
</blockquote>


 
/etc/scripts/madplay_stream.sh
Clear Flash
<blockquote>
<blockquote>
<pre>
<pre>
mtd -r erase rootfs_data
#! /bin/sh
 
while true
do
    wget -O - http://192.168.111.10:8000 | madplay -
    sleep 30
done
 
</pre>
</pre>
</blockquote>
</blockquote>

Latest revision as of 18:28, 12 November 2012

/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.111.20'
	option netmask '255.255.255.0'
	option gateway '192.168.111.1'
	list dns '192.168.111.1'

/config/firewall

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option disable_ipv6 '1'

config zone
	option name 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option network 'lan'

config zone
	option name 'wan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option network 'wifi'

config rule
	option src 'wan'
	option proto 'tcp'
	option dest_port 'ssh'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option src_ip 'fe80::/10'
	option src_port '547'
	option dest_ip 'fe80::/10'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config include
	option path '/etc/firewall.user'

config forwarding
	option dest 'lan'
	option src 'wan'

config forwarding
	option dest 'wan'
	option src 'lan'


/config/fstab

config global automount
	option from_fstab 1
	option anon_mount 1
	
config global autoswap
	option from_fstab 1
	option anon_swap 0
	
config mount
	option target	/home
	option device	/dev/sda1
	option fstype	ext4
	option options	rw,sync
	option enabled	0
	option enabled_fsck 0

config swap
	option device	/dev/sda2
	option enabled	0

/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option hwmode '11ng'
	option htmode 'HT20'
	list ht_capab 'SHORT-GI-20'
	list ht_capab 'SHORT-GI-40'
	list ht_capab 'RX-STBC1'
	list ht_capab 'DSSS_CCK-40'
	option txpower '27'
	option country 'DE'

config wifi-iface
	option device 'radio0'
	option mode 'sta'
	option ssid 'wifi'
	option encryption 'psk2'
	option key 'password'
	option network 'lan'


/config/dhcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'

config dhcp 'lan'
	option interface 'lan'
	option ignore '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config dhcp
	option start '100'
	option leasetime '12h'
	option limit '150'
	option interface 'eth'


/etc/rc.local

alsactl -f /etc/asound.state restore
/etc/scripts/madplay_stream.sh &
exit 0


USB-Sound

opkg update
opkg install kmod-usb-audio kmod-sound-core madplay usbutils alsa-utils

/etc/scripts/madplay_stream.sh

#! /bin/sh

while true
 do
    wget -O - http://192.168.111.10:8000 | madplay -
    sleep 30
 done