Open jaylong255 opened 2 months ago
To change the network from 192.168.x.x
to 172.x.x.x
in OpenWrt, you'll need to modify the network configuration. Here's a step-by-step guide:
192.168.1.1
or whatever your current IP is).lan
).172.x.x.x
range. For example, you might set it to 172.16.1.1
.255.240.0.0
if you want to use the entire 172.16.0.0/12
block, or 255.255.0.0
for 172.16.0.0/16
, or adjust according to your needs.172.16.1.1
in this example).If you prefer or need to use the command line:
SSH into your OpenWrt router using your current IP address.
Edit the network configuration file:
vi /etc/config/network
Find the config interface 'lan'
section and change the option ipaddr
and option netmask
:
config interface 'lan'
option device 'lan'
option proto 'static'
option ipaddr '172.16.1.1'
option netmask '255.255.0.0'
Save and exit the editor (in vi
, press Esc
, then :wq
and Enter).
Restart the network service:
/etc/init.d/network restart
Changing the network range can be disruptive, so ensure you're prepared for potential connectivity issues during the transition.
To set up your new OpenWrt router to act as an access point (AP) or switch, connecting to an existing router (which we'll call the "main router") using 10.0.0.1
, you'll need to configure the WAN interface of the new router to act as a LAN interface that connects to the main router. Here's how you can do this:
You'll need to access the new router's configuration, either through the default IP or by SSH if you've already set it up.
Access LuCI: Go to 192.168.1.1
(or whatever your new router's IP is) in your browser and log in.
Navigate to Network Settings:
Edit WAN Interface:
10.0.0.1
, you might set your new router to 10.0.0.2
with a Subnet Mask of 255.255.255.0
.Save & Apply: Save these settings. Your new router should now be able to communicate with the main router.
SSH into your new OpenWrt router.
Edit the network configuration file:
vi /etc/config/network
Modify the WAN interface:
config interface 'wan'
option ifname 'eth0' # Adjust ifname if different
option proto 'static'
option ipaddr '10.0.0.2'
option netmask '255.255.255.0'
option gateway '10.0.0.1' # This is the IP of your main router
Save and exit the editor (:wq
in vi).
Restart the network service:
/etc/init.d/network restart
If you want the new router to distribute IP addresses to devices connected to it:
LuCI: Go to Network > DHCP and DNS > DHCP Server for the LAN interface. Ensure it's enabled and configure the IP range.
CLI: Edit /etc/config/dhcp
:
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
If you want the new router to also act as a Wi-Fi access point:
LuCI: Go to Wireless > Wireless Network > Add, then configure your Wi-Fi settings.
CLI: Edit /etc/config/wireless
to set up your Wi-Fi SSID and security settings.
IP Conflicts: Ensure the new router's DHCP server doesn't conflict with the main router's DHCP server. You might need to disable DHCP on the main router if the new router is handling DHCP for all devices.
Subnetting: If you're using different subnets, ensure your routing is set up correctly, which might involve static routes or more complex network configurations.
Security: Ensure your new setup doesn't compromise the security of your network, especially if you're sharing the same subnet.
This setup effectively turns your new OpenWrt router into an additional access point or switch, extending the network coverage while still being managed by the main router for internet access.
The default credentials for logging into an OpenWrt admin panel are:
root
root
However, it's important to note:
Security: These are the default credentials, and for security reasons, you should change them immediately after initial login.
Installation Method: If OpenWrt was installed using certain methods or images, the default password might be different. For example, some pre-configured or community images might use different defaults.
Customization: If someone else set up the router or if you've forgotten changes you made, the credentials could be different from the default.
Recovery: If you've lost access and can't remember changing the defaults, you might need to reset the router to factory settings. This usually involves holding down a reset button for a specified period while powering on the device.
If you've changed the password and forgotten it, or if someone else set it up, you'll need to reset the router or find out the changed credentials from the person who set it up. Always ensure you're connecting securely when accessing router settings.