Guest User

Untitled

a guest
Apr 11th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. #!/bin/sh
  2. # configuration script for wrt54g
  3.  
  4. # vim: set foldmethod=marker et :
  5.  
  6. # {{{ network
  7. uci set network.lan.ipaddr='10.0.0.1'
  8. uci set network.lan.ip6addr='2001:6f8:11c0:0:21e:e5ff:fe46:798/64'
  9.  
  10. uci set network.wan.proto='pppoe'
  11. uci set network.wan.username='04216842013'
  12. uci set network.wan.password='25031957'
  13.  
  14. # *** access speedport using ssh with SOCKS for 192.168.0.1
  15. uci set network.speedport='interface'
  16. uci set network.speedport.ifname='eth0.1'
  17. uci set network.speedport.proto='dhcp'
  18.  
  19. uci set wireless.wl0.disabled=0
  20. uci set wireless.@wifi-iface[0].ssid='betelgeuse'
  21. uci set wireless.@wifi-iface[0].encryption='psk+psk2'
  22. uci set wireless.@wifi-iface[0].key='eta-orionis'
  23. # }}}
  24.  
  25. # {{{ dropbear
  26. uci set dropbear.@dropbear[0].PasswordAuth='off'
  27. echo "ssh-dss AAAAB3NzaC1kc3MAAACBAM/d56B9fq8X3S+Vk1125gbqFx2n6yKXu+vk7bNib97SNb3W3kDaydPgHE3v03neK6jtENPOg/NbduvGot7wlpdaYaaPA7wwoYSYT3zsxRYr+AGJd9gHxPJo4whhuESrzTHlHF1QCreFTwb+L2f2qSfmvM905pXejQuGRg6aevOZAAAAFQDEYcj2Oa3rR5J3FDMnPkp6jL66QQAAAIEAorzhmB5fyiypEioQlHJbe1T2ahwZkWAD8gX3dDhDTr0rKOdcEj5S9MyDVwTQaC4+rfSykUkQoiOnPjQXWe5XA6EIzyg9froD3bAiWDAonRDOcaPqpDKf3TUax2cQHnBbWD6CJEel51++G+GBwv/K8tFiKEkMFf7LwoDxHwj1RTgAAACAczhhQQbjpwmIzeH6Hm6otiR8OfrX7xNDHbt5qckMDuCon3lEU1nL121fjss6wX7jahx9ju3aIrpcIo4/EBxKGYVBn2WCnlGmZerlX3g198H43km+C4vnVTVIiv9ol8pXMXCgqtheFSyIg+WVEVBucewRhSQNH/PpuLmylkuBsw8= christoph@thinkpad" > /etc/dropbear/authorized_keys
  28. rm -f /etc/banner
  29. # }}}
  30.  
  31. # {{{ system
  32. uci set system.@system[0].hostname='wrt54g'
  33. uci set system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
  34. # }}}
  35.  
  36. # {{{ hosts
  37. cat > /etc/hosts.local <<EOF
  38. 127.0.0.1 localhost.
  39. 10.0.0.1 wrt54g
  40. 2001:6f8:11c0:0:21e:e5ff:fe46:798 wrt54g
  41. EOF
  42. # }}}
  43.  
  44. # {{{ profile
  45. cat > /etc/profile <<EOF
  46. #!/bin/sh
  47.  
  48. export PATH=/bin:/sbin:/usr/bin:/usr/sbin
  49. export HOME=\$(grep -e "^\${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
  50. export HOME=\${HOME:-/root}
  51. export PS1='\[\\033[01;31m\]\u@\h\[\\033[00m\]:\[\\033[01;34m\]\w\[\\033[00m\]$ '
  52.  
  53. [ -x /bin/more ] || alias more=less
  54. [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
  55.  
  56. [ -z "\$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
  57.  
  58. [ -x /sbin/arp ] || arp() { cat /proc/net/arp; }
  59. [ -z /bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 \$*; }
  60. EOF
  61. # }}}
  62.  
  63. # {{{ aiccu
  64. uci set aiccu.@aiccu[0].username='CPX1-SIXXS'
  65. uci set aiccu.@aiccu[0].password='Iha6JG$sixxs'
  66. uci set aiccu.@aiccu[0].protocol='tic'
  67. uci set aiccu.@aiccu[0].interface='sixxs'
  68. uci set aiccu.@aiccu[0].tunnel_id='T14974'
  69. uci set aiccu.@aiccu[0].defaultroute=1
  70. uci set aiccu.@aiccu[0].nat=1
  71. uci set aiccu.@aiccu[0].heartbeat=1
  72.  
  73. rm -f /etc/rc.d/S50aiccu
  74. echo > /etc/ppp/ip-up.d/aiccu <<EOF
  75. #!/bin/sh
  76. /etc/init.d/aiccu restart
  77. EOF
  78. chmod +x /etc/ppp/ip-up.d/aiccu
  79. # }}}
  80.  
  81. # {{{ radvd
  82. uci set radvd.@interface[0].ignore=0
  83. uci set radvd.@prefix[0].interface='lan'
  84. uci set radvd.@prefix[0].prefix='2001:6f8:11c0:0::/64'
  85. uci set radvd.@prefix[0].AdvOnLink=1
  86. uci set radvd.@prefix[0].AdvAutonomous=1
  87. uci set radvd.@prefix[0].AdvRouterAddr=1
  88. uci set radvd.@prefix[0].ignore=0
  89. # }}}
  90.  
  91. # {{{ enable ipv6 forwarding
  92. sed -i -e 's/# net.ipv6.conf.all.forwarding=1/net.ipv6.conf.all.forwarding=1/' /etc/sysctl.conf
  93. sysctl -p >/dev/null
  94. # }}}
  95.  
  96. # {{{ qos
  97. uci set qos.wan.enabled=1
  98. uci set qos.wan.upload=1024
  99. uci set qos.wan.download=16000
  100. # }}}
  101.  
  102. # {{{ firewall
  103. cat > /etc/firewall.user <<EOF
  104. THINKPAD=10.0.0.167
  105.  
  106. ## transmission
  107. iptables -t nat -A prerouting_wan -p tcp --dport 51413 -j DNAT --to \$THINKPAD
  108. iptables -A forwarding_wan -p tcp --dport 51413 -d \$THINKPAD -j ACCEPT
  109.  
  110. EOF
  111. # }}}
  112.  
  113. # {{{ commit uci settings
  114. uci commit
  115. # }}}
Add Comment
Please, Sign In to add comment