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