Openwrt 安全模式

  1. 设置本地电脑IP 为192.168.1.2
  2. 接上电源
  3. 等待[SYS]等亮起再闪烁3次,立即按[reset] 或 [QSS] 键
  4. 如果看见[SYS]不断闪烁即表示成功进入
  5. 使用telnet 192.168.1.1进入系统
  6. 使用命令:firstboot && reboot
  7. option ifname 'eth0' - move from lan to wan
  8. /etc/init.d/network restart
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 type 'bridge'
          option proto 'static'
          option ipaddr '192.168.1.1'
          option netmask '255.255.255.0'
config interface 'wan'
          option ifname 'eth0'
          option proto 'dhcp' 

Powered by LuCI Trunk (trunk+svn9402) OpenWrt Barrier Breaker r33938
http://downloads.openwrt.org/barrier_breaker/14.07-rc3/ar71xx/generic/packages/
src/gz barrier_breaker http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/packages


Reset Factory Default (Verson 2)

  1. Power off the router
  2. Unplug the WAN port, if not unplug, you cannot enter failsafe mode
  3. Two ways as below. Hardware button is either RESET or WPS/RESET
  4. - Press the hardware button, then power up OR
    - Power up, immediately press hardware button
  5. SYS LED change to faster blink pattern, the router is now in failsafe mode (192.168.1.1)
  6. Set your computer's IP to 192.168.1.2, subnet 255.255.255.0. Connect to RJ45 LAN port
  7. Telnet/ SSH to it, do so as a privileged user, and do:
     mount_root
     mtd -r erase rootfs_data
     reboot -f 

EXT-ROOT

因为USB驱动前边支持3G的时候已经装了一部分,现在另需要的包有:block-mount,kmod-fs-ext4,e2fsprogs,kmod-scsi-generic 以上所列的包都是必须的,也是我目前试验所得最少量的包,所有装完后剩余空间500k左右。

装完后操作:

  1. 格式化TF卡及拷文件
    (此时如果卡没识别就reboot一下)
    (此处我是整个卡格的,我是把tf卡挂整个根分区的,以后所有的sda1就换成sda即可)
     mkfs.ext4 /dev/sda1
     mount /dev/sda1 /mnt
     mkdir /tmp/cproot
     mount --bind / /tmp/cproot
     tar -C /tmp/cproot -cvf - . | tar -C /mnt -xvf -
     sync
     umount /mnt
     umount /tmp/cproot
    
  2. 修改/etc/config/fstab
     config mount
             option target        /
             option device        /dev/sda1
             option fstype        ext4
             option options       rw,sync
             option enabled       1
             option enabled_fsck  0 
    
  3. 这是很关键的一步,因为没有界面要通过命令完成
    这行命令是把usb驱动放到挂载前边,否则会挂不成功
     /etc/init.d/fstab enable
     mv /etc/rc.d/S39usb /etc/rc.d/S19usb
    
  4. 重新启动
    root@OpenWrt:~# df -k
    Filesystem           1K-blocks      Used Available Use% Mounted on
    rootfs                 7791672    271428   7129412   4% /
    /dev/root                 6400      6400         0 100% /rom
    tmpfs                    30920       264     30656   1% /tmp
    tmpfs                      512         0       512   0% /dev
    /dev/sda1              7791672    271428   7129412   4% /
    

WR1043ND - Button Toggle DHCP on/off

  1. mkdir /etc/hotplug.d/button
  2. vi 10-dhcp-toggle
     #!/bin/sh
    logger $BUTTON
    logger $ACTION
    if [ $BUTTON != "wps" -o $ACTION != "pressed" ]; then exit 0; fi
    dhcpst=/bin/ps | /bin/grep "dnsmasq" | /usr/bin/wc -l
    case $dhcpst in
            1) # DHCP OFF - turn on
                    echo 1 > /sys/devices/platform/leds-gpio/leds/tp-link:green:qss/brightness
                    /etc/init.d/dnsmasq start
                    echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:qss/brightness
                    sleep 1
                    echo 1 > /sys/devices/platform/leds-gpio/leds/tp-link:green:qss/brightness
                    ;;
            2) # DHCP ON - turn off
                    /etc/init.d/dnsmasq stop
                    echo 0 > /sys/devices/platform/leds-gpio/leds/tp-link:green:qss/brightness
                    ;;
    esac

  3. logread

Labels: my.