Openwrt: Difference between revisions
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Failsafe mode== | ==Failsafe mode== | ||
Line 44: | Line 39: | ||
uci commit dhcp | uci commit dhcp | ||
==Reset DHCP OpenWrt== | |||
uci set network.lan.proto=static | |||
uci set network.lan.ipaddr=192.168.1.10 | |||
uci set network.lan.gateway=192.168.1.1 | |||
uci set network.lan.netmask=255.255.255.0 | |||
uci set network.lan.dns=8.8.8.8 | |||
uci dhcp commit | |||
==Birdge AP== | |||
The changes below assume an OpenWrt default configuration, the relevant files are: | |||
/etc/config/network | |||
/etc/config/wireless | |||
Step 1: Change the LAN interface | |||
Edit /etc/config/network and change the lan interface section to set the IP your access point should have in the future: | |||
config interface lan | |||
option ifname eth0 | |||
option type bridge | |||
option proto static | |||
option ipaddr 192.168.1.2 | |||
option netmask 255.255.255.0 | |||
option gateway 192.168.1.1 | |||
option dns 192.168.1.1 | |||
This IP address must be an unused one within the network subnet of the main router. You could also change proto to dhcp and let the main router decide the access point's address, but of course from then on the access point needs a DHCP server and you will lose the ability to directly plug into your access point for maintenance. | |||
Step 2: Configure and enable the wireless network | |||
In /etc/config/wireless, locate the existing wifi-iface section and change its network option to point to the newly created interface section. | |||
config wifi-iface | |||
option device wifi0 | |||
option network lan | |||
option mode ap | |||
option ssid OpenWrt | |||
option encryption none | |||
Naturally, you should consider securing your wifi network. | |||
Step 3: Disable dnsmasq | |||
/etc/init.d/dnsmasq disable | |||
Step 4: Connect host router and openwrt router correctly | |||
Ensure the host router is connected with a lan port of the openwrt, not the wan port! | |||
Apply changes | |||
Enable the new wireless network. | |||
root@OpenWrt:~# ifup wifi | |||
root@OpenWrt:~# wifi | |||
==Traffic Monitor== | ==Traffic Monitor== |
Latest revision as of 00:45, 19 August 2018
Failsafe mode
1. Set your PC ip: 192.168.1.2 and subnetmask 255.255.255.0 and gateway 192.168.1.1
2. Power off the router
3. Disconnect the WAN cable
4. Only connect your PC Ethernet cable to ETH0
5. Power On the router
6. Wait for the router to start the boot sequence (SYS LED starts blinking)
7. When SYS LED is blinking, hit restart button (SYS LED will be blink in a faster rate means your router is in failsafe Mode) (you have to hit the button before the router boots)
8. telnet 192.168.1.1
9. run these commands
mount_root ## this remounts your partitions from read-only to read/write mode
firstboot ## This will reset your router after reboot
reboot -f ## And force reboot
Login the web interface using web browser.
mount_root
uci set network.lan.proto=static uci set network.lan.ipaddr=192.168.1.10 uci set network.lan.netmask=255.255.255.0 uci set network.lan.gateway=192.168.1.1 uci set network.lan.dns=8.8.8.8
uci commit dhcp
Reset DHCP OpenWrt
uci set network.lan.proto=static uci set network.lan.ipaddr=192.168.1.10 uci set network.lan.gateway=192.168.1.1 uci set network.lan.netmask=255.255.255.0 uci set network.lan.dns=8.8.8.8 uci dhcp commit
Birdge AP
The changes below assume an OpenWrt default configuration, the relevant files are:
/etc/config/network /etc/config/wireless Step 1: Change the LAN interface Edit /etc/config/network and change the lan interface section to set the IP your access point should have in the future:
config interface lan
option ifname eth0 option type bridge option proto static option ipaddr 192.168.1.2 option netmask 255.255.255.0 option gateway 192.168.1.1 option dns 192.168.1.1
This IP address must be an unused one within the network subnet of the main router. You could also change proto to dhcp and let the main router decide the access point's address, but of course from then on the access point needs a DHCP server and you will lose the ability to directly plug into your access point for maintenance.
Step 2: Configure and enable the wireless network In /etc/config/wireless, locate the existing wifi-iface section and change its network option to point to the newly created interface section.
config wifi-iface
option device wifi0 option network lan option mode ap option ssid OpenWrt option encryption none
Naturally, you should consider securing your wifi network.
Step 3: Disable dnsmasq /etc/init.d/dnsmasq disable Step 4: Connect host router and openwrt router correctly Ensure the host router is connected with a lan port of the openwrt, not the wan port!
Apply changes Enable the new wireless network.
root@OpenWrt:~# ifup wifi root@OpenWrt:~# wifi
Traffic Monitor
opkg install iftop
iftop -i br-lan
OpenVPN
https://wiki.openwrt.org/toh/tp-link/tl-wdr3600
183 209