Последняя активность 6 months ago

openwrt_x86.install Исходник
1# look also at
2# http://wiki.openwrt.org/doc/recipes/relayclient
3# http://wiki.openwrt.org/doc/recipes/dumbap
4
5# disable dhcp on lan interface (just in case there is a dhcp server running)
6uci set dhcp.lan.ignore=1
7uci set dhcp.@dnsmasq[0].nonegcache=1
8uci commit dhcp
9/etc/init.d/dnsmasq restart
10
11# set network config (adjust as your needs)
12uci set network.lan.gateway=192.168.10.1
13uci set network.lan.dns=8.8.8.8
14uci commit network
15/etc/init.d/network reload
16
17# rename the router
18uci set system.@system[0].hostname=MyRouter
19uci commit system
20/etc/init.d/system restart
21
22# enable remote logging
23uci set system.@system[0].log_ip=192.168.1.2
24uci set system.@system[0].conloglevel=7
25uci commit system
26/etc/init.d/log restart
27
28# disable preinstalled firewall
29/etc/init.d/firewall disable && /etc/init.d/firewall stop
30
31# refresh list of available packages
32opkg update
33
34# install usb keyboad support
35opkg install kmod-usb-hid kmod-hid-generic
36
37# install ipv6 config webinterface part
38opkg install luci-proto-ipv6
39
40# install usefull packages
41opkg install tcpdump rsync ip
42
43# install webinterface (and QoS Interface)
44opkg install luci-mod-admin-full uhttpd libiwinfo-lua luci-app-qos luci-proto-ppp
45/etc/init.d/uhttpd enable; /etc/init.d/uhttpd start
46
47# enable network hardware
48opkg install kmod-tulip kmod-e1000e; modprobe e1000e; modprobe tulip
49
50# install shorewall
51# opkg install shorewall-lite
52# install iptables packages
53opkg install iptables-mod-conntrack-extra iptables-mod-ipopt iptables-mod-iprange
54# optional iptables capabilities
55opkg install iptables-mod-filter iptables-mod-iface iptables-mod-ipp2p iptables-mod-ipv4options l7-protocols
56# install ipset
57opkg install ipset
58
59# here configuration of shorewall needs to be deployed
60# maybe look into http://wiki.openwrt.org/doc/recipes/shorewall-on-openwrt
61#mkdir -p /etc/shorewall-lite/state/ && touch /etc/shorewall-lite/state/firewall
62
63# Fix broken shorewall-lite Makefile
64SBIN=$(which shorewall-lite); sed -i "s#/usr/sbin/shorewall-lite#${SBIN}#g" /etc/shorewall-lite/Makefile
65# Fix broken shorewallrc
66SBIN=$(which shorewall-lite); SBINDIR=$(dirname ${SBIN}); sed -i s#/usr/sbin#${SBINDIR}#g /usr/share/shorewall/shorewallrc
67# enable shorewall
68/etc/init.d/shorewall-lite enable
69