Skip to content

Commit

Permalink
Merge pull request #4 from danielvijge/feature/update-to-openwrt-23.05
Browse files Browse the repository at this point in the history
Update to OpenWrt 23.05
  • Loading branch information
danielvijge authored Oct 13, 2023
2 parents 127927b + 3ec45f1 commit c4ab5bf
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
persist-credentials: false
fetch-depth: 0
- name: Run Ansible Playbook
uses: arillso/action.playbook@master
uses: ansible-lockdown/action.playbook@main
with:
playbook: test_config_local.yaml
inventory: inventory-sample.yaml
Expand Down
1 change: 1 addition & 0 deletions ansible-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ roles:
- name: gekmihesg.openwrt
collections:
- name: ansible.utils
- name: community.general
3 changes: 2 additions & 1 deletion bin/upgrade-all-packages
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ if [ $LATEST_RELEASE != $DISTRIB_RELEASE ]; then
fi
echo ""

echo "Updating package list..."
echo -n "Updating package list..."
opkg update > /dev/null
echo ""

if [ `opkg list-upgradable | cut -d " " -f1 | wc -l` -gt 0 ]; then
echo "Available updates:"
Expand Down
48 changes: 29 additions & 19 deletions config/network
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ config interface 'loopback'
config globals 'globals'
option ula_prefix '{{ ula_prefix }}'

config device 'wan_eth0_2_dev'
config device
{% if vlans is defined %}
option name 'eth0.{{ vlans | community.general.json_query('[?wan].vid') | first }}'
{% else %}
option name 'eth0.2'
{% endif %}
option macaddr '{{ mac }}'

config switch
Expand All @@ -32,11 +36,19 @@ config interface 'lan'
option ip6ifaceid '::{{ id }}'

config interface 'wan'
option device 'eth0.300'
{% if vlans is defined %}
option device 'eth0.{{ vlans | community.general.json_query('[?wan].vid') | first }}'
{% else %}
option device 'eth0.2'
{% endif %}
option proto 'dhcp'

config interface 'wan6'
option device 'eth0.300'
{% if vlans is defined %}
option device 'eth0.{{ vlans | community.general.json_query('[?wan].vid') | first }}'
{% else %}
option device 'eth0.2'
{% endif %}
option proto 'dhcpv6'
option reqaddress 'try'
option reqprefix 'auto'
Expand All @@ -47,26 +59,24 @@ config switch_vlan
option ports '0t 2 3 4 5'
option vid '1'

{% if vlans is defined %}
{% for vlan in vlans %}
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 1t'
option vid '100'
option description 'Management'

config switch_vlan
option device 'switch0'
option vlan '3'
option ports '0t 1t'
option vid '300'
option description 'Internet'
option vlan '{{ loop.index+1 }}'
option ports '{{ vlan.ports }}'
option vid '{{ vlan.vid }}'
{% if vlan.name is defined %}
option description '{{ vlan.name }}'
{% endif %}

{% endfor %}
{% else %}
config switch_vlan
option device 'switch0'
option vlan '4'
option ports '0t 1t'
option vid '640'
option description 'Television'
option devide 'switch0'
option vlan '2'
option ports '0t 2 3 4 5'
{% endif %}

{% if ipv6_6to4 is defined %}
config interface 'wan6to4'
Expand Down
2 changes: 1 addition & 1 deletion config/system
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config led
option default '0'
{% if inventory_hostname in groups['routers'] %}
option trigger 'netdev'
option dev 'eth0.2'
option dev 'eth0'
list mode 'tx'
list mode 'rx'
{% else %}
Expand Down
17 changes: 14 additions & 3 deletions inventory-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,13 @@ openwrt:
# installed is always common_packages_installed + packages_installed
common_packages:
install:
- wpad-wolfssl
- luci-ssl
- wpad-mbedtls
- nano
- fping
# Packages that will be removed on all devices. Use `packages_removed`
# to set packages on a group level that should be removed.
remove:
- wpad-basic-wolfssl
- wpad-basic-mbedtls
# Network address, this would allow address from 10.0.0.1 - 10.0.0.255
network: 10.0.0.0/24
# Local domain name
Expand Down Expand Up @@ -206,3 +205,15 @@ openwrt:
# retrieved.
upnp:
configure_with_external_ip: false
# Optional configuration for VLANs
# vlans:
# - name: Management
# vid: 100
# ports: 0t 1t
# - name: Internet
# vid: 300
# ports: 0t 1t
# # for the main VLAN that connect to the WAN, set wan to true
# wan: true
# - name: Television
# vid: 640
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Besides a description of the setup, this repository also includes an
Ansible playbook and inventory to centrally apply configuration changes
to all devices and/or update the firmware version on all devices.

This configuration and the Ansible playbook have been tested with OpenWrt 22.03, 21.02, and 19.07.
This configuration and the Ansible playbook have been tested with OpenWrt 23.05, 22.03, 21.02, and 19.07.
It has at least been tested on TP-Link Archer C7-v5 and TP-Link WDR4300 v1, but in theory any
router supported by OpenWrt should work.

The main branch is based on OpenWrt 22.03. The branches _openwrt-22.02_ and _openwrt-19.07_ contains
the previous configurations for 22.02 and 19.07 respectively. A lot of improvements from later version
The main branch is based on OpenWrt 23.05. The branches _openwrt-22.03_, _openwrt-21.02_ and _openwrt-19.07_ contains
the previous configurations for 21.02 and 19.07 respectively. A lot of improvements from later version
could be backported to older version, if desired.

## Table of content
Expand Down Expand Up @@ -57,8 +57,8 @@ things can be configured as desired.

### Packages

* Remove the package _wpad-basic-wolfssl_.
* Install the packages _wpad-wolfssl_ and _luci-app-dawn_.
* Remove the package _wpad-basic-mbedtls.
* Install the packages _wpad-mbedtls and _luci-app-dawn_.

### System

Expand Down Expand Up @@ -137,8 +137,8 @@ Each access point is configured in the same way.

### Packages

* Remove the package _wpad-basic-wolfssl_.
* Install the package _wpad-wolfssl_ and _dawn_.
* Remove the package _wpad-basic-mbedtls_.
* Install the package _wpad-mbedtls_ and _dawn_.

### System

Expand Down

0 comments on commit c4ab5bf

Please sign in to comment.