poradziłem sobie mam certyfikaty i laczy mnie z siecia ale nie mam dostepu do wewnetrznych ip i komputerow oraz nie mam internetu z tamtej sieci
wywala mi takie cos
uci commit firewall
/etc/init.d/firewall restartcfg1dad58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='myvpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~#
root@OpenWrt:~# uci add firewall forwarding
cfg1ead58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='myvpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
Section @rule[9] option '_name' is deprecated by fw4
Section @forwarding[1] option 'src' specifies invalid value 'vpn'
Section @forwarding[1] skipped due to invalid options
Section @forwarding[2] option 'src' specifies invalid value 'vpn'
Section @forwarding[2] skipped due to invalid options
Section @forwarding[3] option 'src' specifies invalid value 'vpn'
Section @forwarding[3] skipped due to invalid options
Section @forwarding[4] option 'src' specifies invalid value 'vpn'
Section @forwarding[4] skipped due to invalid options
Section @forwarding[5] option 'src' specifies invalid value 'myvpn'
Section @forwarding[5] skipped due to invalid options
Section @forwarding[6] option 'src' specifies invalid value 'myvpn'
Section @forwarding[6] skipped due to invalid options
Section @forwarding[7] option 'src' specifies invalid value 'myvpn'
Section @forwarding[7] skipped due to invalid options
Section @forwarding[8] option 'src' specifies invalid value 'myvpn'
Section @forwarding[8] skipped due to invalid options
Section @forwarding[9] option 'src' specifies invalid value 'myvpn'
Section @forwarding[9] skipped due to invalid options
Section @forwarding[10] option 'src' specifies invalid value 'myvpn'
Section @forwarding[10] skipped due to invalid options
Section @forwarding[11] option 'src' specifies invalid value 'myvpn'
Section @forwarding[11] skipped due to invalid options
Section @forwarding[12] option 'src' specifies invalid value 'myvpn'
Section @forwarding[12] skipped due to invalid options
Section @forwarding[13] option 'src' specifies invalid value 'myvpn'
Section @forwarding[13] skipped due to invalid options
root@OpenWrt:~# iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o br-lan -j MASQU
ERADE
-ash: iptables: not found
root@OpenWrt:~# ^Ctables -t nat -A POSTROUTING -s 10.8.0.0/24 -o br-lan -j MASQU
ERADE
root@OpenWrt:~# clear
root@OpenWrt:~# port 1194
-ash: port: not found
root@OpenWrt:~# proto udp
-ash: dev tun
proto: not found
root@OpenWrt:~# dev tun
-ash: dev: not found
root@OpenWrt:~#
ca /etc/openvpn/ca.crt
root@OpenWrt:~# ca /etc/openvpn/ca.crt
-ash: ca: not found
root@OpenWrt:~# cert /etc/openvpn/server.crt
-ash: cert: not found
root@OpenWrt:~# key /etc/openvpn/server.key
-ash: key: not found
root@OpenWrt:~# dh /etc/openvpn/dh.pem
-ash: dh: not found
root@OpenWrt:~#
root@OpenWrt:~# server 10.8.0.0 255.255.255.0
-ash: server: not found
root@OpenWrt:~# push "route 192.168.111.0 255.255.255.0"
-ash: push: not found
root@OpenWrt:~#
root@OpenWrt:~# keepalive 10 120
-ash: keepalive: not found
root@OpenWrt:~# persist-key
-ash: persist-key: not found
root@OpenWrt:~# persist-tun
-ash: persist-tun: not found
root@OpenWrt:~# status /tmp/openvpn-status.log
-ash: status: not found
root@OpenWrt:~# verb 3
-ash: verb: not found
root@OpenWrt:~# uci show firewall | grep zoneuci show firewall | grep zone
grep: show: No such file or directory
grep: firewall: No such file or directory
root@OpenWrt:~# uci add firewall zone
uci set firewall.@zone[-1].name='vpn'
uci set firewall.@zone[-1].input='ACCEPT'
uci set firewall.@zone[-1].forward='REJECT'
uci set firewall.@zone[-1].output='ACCEPT'
uci set firewall.@zone[-1].network='tun0'
uci commit firewall
/etc/init.d/firewall restartcfg1fdc81
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='REJECT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].network='tun0'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
Section @rule[9] option '_name' is deprecated by fw4
Section @forwarding[5] option 'src' specifies invalid value 'myvpn'
Section @forwarding[5] skipped due to invalid options
Section @forwarding[6] option 'src' specifies invalid value 'myvpn'
Section @forwarding[6] skipped due to invalid options
Section @forwarding[7] option 'src' specifies invalid value 'myvpn'
Section @forwarding[7] skipped due to invalid options
Section @forwarding[8] option 'src' specifies invalid value 'myvpn'
Section @forwarding[8] skipped due to invalid options
Section @forwarding[9] option 'src' specifies invalid value 'myvpn'
Section @forwarding[9] skipped due to invalid options
Section @forwarding[10] option 'src' specifies invalid value 'myvpn'
Section @forwarding[10] skipped due to invalid options
Section @forwarding[11] option 'src' specifies invalid value 'myvpn'
Section @forwarding[11] skipped due to invalid options
Section @forwarding[12] option 'src' specifies invalid value 'myvpn'
Section @forwarding[12] skipped due to invalid options
Section @forwarding[13] option 'src' specifies invalid value 'myvpn'
Section @forwarding[13] skipped due to invalid options
root@OpenWrt:~# uci add firewall zone
uci set firewall.@zone[-1].name='vpn'
uci set firewall.@zone[-1].input='ACCEPT'
uci set firewall.@zone[-1].forward='REJECT'
uci set firewall.@zone[-1].output='ACCEPT'
uci set firewall.@zone[-1].network='tun0'
uci commit firewall
/etc/init.d/firewall restartcfg20dc81
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='REJECT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].network='tun0'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/ … ackages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/ … ckages.sig
Signature check passed.
root@OpenWrt:~# opkg install iptables-mod-nat
Unknown package 'iptables-mod-nat'.
Collected errors:
* opkg_install_cmd: Cannot install package iptables-mod-nat.
root@OpenWrt:~#
root@OpenWrt:~# root@OpenWrt:~# opkg install iptables-mod-nat
-ash: root@OpenWrt:~#: not found
root@OpenWrt:~# Unknown package 'iptables-mod-nat'.
-ash: Unknown: not found
root@OpenWrt:~# Collected errors:
-ash: Collected: not found
root@OpenWrt:~# * opkg_install_cmd: Cannot install package iptables-mod-nat.
-ash: *: not found
root@OpenWrt:~# root@OpenWrt:~#
-ash: root@OpenWrt:~#: not found
root@OpenWrt:~# uci add firewall zone
cfg21dc81
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='REJECT'
root@OpenWrt:~# uci set firewall.@zone[-1].network='tun0'
root@OpenWrt:~# uci commit firewalluci add firewall zone
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='REJECT'
root@OpenWrt:~# uci set firewall.@zone[-1].network='tun0'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# # VPN -> LAN
root@OpenWrt:~# uci add firewall forwarding
cfg22ad58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~#
root@OpenWrt:~# # VPN -> WAN (internet)
root@OpenWrt:~# uci add firewall forwarding
cfg23ad58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart# VPN -> LAN
root@OpenWrt:~# uci add firewall forwarding
cfg24ad58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~#
root@OpenWrt:~# # VPN -> WAN (internet)
root@OpenWrt:~# uci add firewall forwarding
cfg25ad58
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
/dev/stdin:21:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# uci delete firewall.@zone[vpn]
uci: Invalid argument
root@OpenWrt:~# uci delete firewall.@forwarding[-1] # usuwa ostatnie forwardin
gi, jeśli były błędne
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
/dev/stdin:21:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# cat /etc/config/firewall | grep vpn_devices -n
root@OpenWrt:~# ^C
root@OpenWrt:~# cat /etc/firewall.user
iptables -I OUTPUT -o tap+ -j ACCEPT
iptables -I INPUT -i tap+ -j ACCEPT
iptables -I FORWARD -o tap+ -j ACCEPT
iptables -I FORWARD -i tap+ -j ACCEPT
root@OpenWrt:~# ^C
root@OpenWrt:~# uci set network.vpn=interface
root@OpenWrt:~# uci set network.vpn.ifname='tun0'
root@OpenWrt:~# uci set network.vpn.proto='none'
root@OpenWrt:~# uci commit network
root@OpenWrt:~# uci add firewall.forwarding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
/dev/stdin:21:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# uci delete firewall.@forwarding[-1]
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci set network.vpn=interface
root@OpenWrt:~# uci set network.vpn.ifname='tun0'
root@OpenWrt:~# uci set network.vpn.proto='none'
root@OpenWrt:~# uci commit network
root@OpenWrt:~# uci add firewall.zone
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].network='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci add firewall.forwarding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
uci add firewall.forwarding
uci set firewall.@forwarding[-1].src='vpn'
uci set firewall.@forwarding[-1].dest='lan'root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'uci add firewall.forw
arding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~# uci add firewall.forwarding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restartuci add firewall.forwarding
Syntax: /etc/init.d/firewall [command]
Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if service does not implement reload)
enable Enable service autostart
disable Disable service autostart
enabled Check if service is started on boot
running Check if service is running
status Service status
trace Start with syscall trace
info Dump procd service info
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
/dev/stdin:21:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { "tun0" }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# uci delete firewall.@forwarding[-1]
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci set network.vpn=interface
root@OpenWrt:~# uci set network.vpn.ifname='tun0'
root@OpenWrt:~# uci set network.vpn.proto='none'
root@OpenWrt:~# uci commit network
root@OpenWrt:~# uci add firewall.zone
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].network='vpn'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='ACCEPT'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci add firewall.forwarding
uci commit firewall
/etc/init.d/firewall restartUsage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~#
root@OpenWrt:~# uci add firewall.forwarding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpn'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
/dev/stdin:21:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { "tun0" }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C
root@OpenWrt:~# uci delete firewall.@forwarding[-1]uci delete firewall.@forwardi
ng[-1]
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci add firewall.zone
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@zone[-1].name='vpnzone'
root@OpenWrt:~# uci set firewall.@zone[-1].network='tun0'
root@OpenWrt:~# uci set firewall.@zone[-1].input='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].output='ACCEPT'
root@OpenWrt:~# uci set firewall.@zone[-1].forward='ACCEPT'
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# uci add firewall.forwarding
uci commit firewall
/etc/init.d/firewall restartUsage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpnzone'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='lan'
root@OpenWrt:~#
root@OpenWrt:~# uci add firewall.forwarding
Usage: uci [<options>] <command> [<arguments>]
Commands:
batch
export [<config>]
import [<config>]
changes [<config>]
commit [<config>]
add <config> <section-type>
add_list <config>.<section>.<option>=<string>
del_list <config>.<section>.<option>=<string>
show [<config>[.<section>[.<option>]]]
get <config>.<section>[.<option>]
set <config>.<section>[.<option>]=<value>
delete <config>[.<section>[[.<option>][=<id>]]]
rename <config>.<section>[.<option>]=<name>
revert <config>[.<section>[.<option>]]
reorder <config>.<section>=<position>
Options:
-c <path> set the search path for config files (default: /etc/config)
-C <path> set the search path for config override files (default: /var/run/uci)
-d <str> set the delimiter for list values in uci show
-f <file> use <file> as input instead of stdin
-m when importing, merge data into an existing package
-n name unnamed sections on export (default)
-N don't name unnamed sections
-p <path> add a search path for config change files
-P <path> add a search path for config change files and use as default
-t <path> set save path for config change files
-q quiet mode (don't print error messages)
-s force strict mode (stop on parser errors, default)
-S disable strict mode
-X do not use extended syntax on 'show'
root@OpenWrt:~# uci set firewall.@forwarding[-1].src='vpnzone'
root@OpenWrt:~# uci set firewall.@forwarding[-1].dest='wan'
root@OpenWrt:~#
root@OpenWrt:~# uci commit firewall
root@OpenWrt:~# /etc/init.d/firewall restart
/dev/stdin:18:9-19: Error: redefinition of symbol 'vpn_devices'
define vpn_devices = { }
^^^^^^^^^^^
The rendered ruleset contains errors, not doing firewall restart.
root@OpenWrt:~# ^C