Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networking - Configure an OpenWrt Router in Front of Spectrum #49

Open
jaylong255 opened this issue Aug 30, 2024 · 3 comments
Open

Networking - Configure an OpenWrt Router in Front of Spectrum #49

jaylong255 opened this issue Aug 30, 2024 · 3 comments

Comments

@jaylong255
Copy link
Member

No description provided.

@jaylong255
Copy link
Member Author

The default credentials for logging into an OpenWrt admin panel are:

  • Username: root
  • Password: root

However, it's important to note:

  1. Security: These are the default credentials, and for security reasons, you should change them immediately after initial login.

  2. 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.

  3. Customization: If someone else set up the router or if you've forgotten changes you made, the credentials could be different from the default.

  4. 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.

@jaylong255
Copy link
Member Author

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:

Step 1: Access the LuCI Interface

  • Open your web browser and navigate to your current router IP (e.g., 192.168.1.1 or whatever your current IP is).
  • Log in using your credentials.

Step 2: Navigate to Network Settings

  • Go to Network > Interfaces.

Step 3: Edit LAN Interface

  • Find the LAN interface (usually named lan).
  • Click on the Edit button next to it.

Step 4: Change the IP Address

  • In the IPv4 Configuration Type, ensure it's set to Static address.
  • Change the IP Address to something in the 172.x.x.x range. For example, you might set it to 172.16.1.1.
  • Set the Subnet Mask to 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.

Step 5: Save and Apply

  • Scroll down and click Save & Apply.
  • You might be disconnected from the router as the IP changes. Reconnect to the new IP address (172.16.1.1 in this example).

Alternative: Using Command Line

If you prefer or need to use the command line:

  1. SSH into your OpenWrt router using your current IP address.

  2. Edit the network configuration file:

    vi /etc/config/network
  3. 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'
  4. Save and exit the editor (in vi, press Esc, then :wq and Enter).

  5. Restart the network service:

    /etc/init.d/network restart

Important Notes:

  • Device Reconfiguration: All devices connected to your network will need to be reconfigured to use the new IP range, either manually or through DHCP if you set it up.
  • DHCP Server: If you're running a DHCP server on your OpenWrt, you'll need to adjust its configuration to match the new network range.
  • Static Routes: If you have any static routes or firewall rules based on the old IP, you'll need to update them.

Changing the network range can be disruptive, so ensure you're prepared for potential connectivity issues during the transition.

@jaylong255
Copy link
Member Author

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:

Step 1: Connect the Routers

  • Physically connect the WAN port of your new OpenWrt router to one of the LAN ports of the existing router using an Ethernet cable.

Step 2: Configure the New Router's WAN Interface as LAN

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.

Using LuCI Web Interface:

  1. Access LuCI: Go to 192.168.1.1 (or whatever your new router's IP is) in your browser and log in.

  2. Navigate to Network Settings:

    • Go to Network > Interfaces.
  3. Edit WAN Interface:

    • Find the WAN interface and click Edit.
    • Change the Protocol to Static address.
    • Set an IP Address in the same subnet as your main router. For example, if your main router uses 10.0.0.1, you might set your new router to 10.0.0.2 with a Subnet Mask of 255.255.255.0.
  4. Save & Apply: Save these settings. Your new router should now be able to communicate with the main router.

Using Command Line (SSH):

  1. SSH into your new OpenWrt router.

  2. Edit the network configuration file:

    vi /etc/config/network
  3. 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
  4. Save and exit the editor (:wq in vi).

  5. Restart the network service:

    /etc/init.d/network restart

Step 3: Configure DHCP for the New Network

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'

Step 4: Set Up Wireless (If Acting as an Access Point)

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.

Step 5: Test the Connection

  • Connect devices to the new router (either via Ethernet or Wi-Fi if configured).
  • Ensure they can access the internet and communicate with devices on the main network.

Important Considerations:

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant