Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| docs:guide-user:network:routing:examples:pbr_app [2023/09/07 19:43] – [Ignore local destinations] vgaetera | docs:guide-user:network:routing:examples:pbr_app [2023/09/07 22:17] (current) – move to docs:guide-user:network:routing:pbr_app vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Routing example: PBR app ====== | ||
| - | {{section> | ||
| - | |||
| - | ===== Introduction ===== | ||
| - | [[https:// | ||
| - | |||
| - | ===== Command-line instructions ===== | ||
| - | Install and enable PBR app. | ||
| - | |||
| - | <code bash> | ||
| - | # Install packages | ||
| - | opkg update | ||
| - | opkg install pbr | ||
| - | |||
| - | # Enable PBR | ||
| - | uci set pbr.config.enabled=" | ||
| - | uci set pbr.config.resolver_ipset=" | ||
| - | uci set pbr.config.webui_show_ignore_target=" | ||
| - | uci commit pbr | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | ===== Extras ===== | ||
| - | ==== Web interface ==== | ||
| - | If you want to manage PBR settings using web interface. | ||
| - | Install the necessary packages. | ||
| - | |||
| - | <code bash> | ||
| - | # Install packages | ||
| - | opkg update | ||
| - | opkg install luci-app-pbr | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | ==== Route LAN to VPN ==== | ||
| - | [[https:// | ||
| - | Route LAN '' | ||
| - | |||
| - | <code bash> | ||
| - | # Route LAN to VPN | ||
| - | uci add pbr policy | ||
| - | uci set pbr.@policy[-1].src_addr=" | ||
| - | uci set pbr.@policy[-1].interface=" | ||
| - | uci commit pbr | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | ==== Forward WAN port ==== | ||
| - | Forward WAN port to a webserver running on '' | ||
| - | Arrange this policy above more generic ones. | ||
| - | |||
| - | <code bash> | ||
| - | # Forward WAN port | ||
| - | uci add pbr policy | ||
| - | uci set pbr.@policy[-1].src_addr=" | ||
| - | uci set pbr.@policy[-1].src_port=" | ||
| - | uci set pbr.@policy[-1].proto=" | ||
| - | uci set pbr.@policy[-1].interface=" | ||
| - | uci reorder pbr.@policy[-1]=" | ||
| - | uci commit pbr | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | ==== Ignore local destinations ==== | ||
| - | Possible race conditions can disrupt routing between local networks. | ||
| - | Configure exception for local destinations '' | ||
| - | Arrange this policy above all others. | ||
| - | |||
| - | <code bash> | ||
| - | # Ignore local destinations | ||
| - | uci add pbr policy | ||
| - | uci set pbr.@policy[-1].dest_addr=" | ||
| - | uci set pbr.@policy[-1].interface=" | ||
| - | uci reorder pbr.@policy[-1]=" | ||
| - | uci commit pbr | ||
| - | / | ||
| - | </ | ||