46 lines
1.5 KiB
Bash
Executable File
46 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
|
|
uci_remove network local_node_dev
|
|
uci_add network device local_node_dev
|
|
uci_set network local_node_dev name 'local-node'
|
|
uci_set network local_node_dev ifname '@client'
|
|
uci_set network local_node_dev type 'macvlan'
|
|
uci_set network local_node_dev macaddr '@next_node.mac@'
|
|
|
|
uci_remove network local_node
|
|
uci_add network interface local_node
|
|
uci_set network local_node ifname 'local-node'
|
|
uci_set network local_node proto 'static'
|
|
uci_set network local_node ipaddr '@next_node.ip4@'
|
|
uci_set network local_node netmask '255.255.255.255'
|
|
uci_set network local_node ip6addr '@next_node.ip6@/128'
|
|
|
|
eval $(ipcalc.sh '@prefix4@')
|
|
|
|
uci_remove network local_node_route4
|
|
uci_add network route local_node_route4
|
|
uci_set network local_node_route4 interface 'client'
|
|
uci_set network local_node_route4 target "$IP"
|
|
uci_set network local_node_route4 netmask "$NETMASK"
|
|
uci_set network local_node_route4 gateway '0.0.0.0'
|
|
|
|
uci_remove network local_node_route6
|
|
uci_add network route6 local_node_route6
|
|
uci_set network local_node_route6 interface 'client'
|
|
uci_set network local_node_route6 target '@prefix6@'
|
|
uci_set network local_node_route6 gateway '::'
|
|
|
|
uci_commit network
|
|
|
|
uci_remove firewall local_node
|
|
uci_add firewall zone local_node
|
|
uci_set firewall local_node name 'local_node'
|
|
uci add_list firewall.local_node.network='local_node'
|
|
uci_set firewall local_node input 'ACCEPT'
|
|
uci_set firewall local_node output 'ACCEPT'
|
|
uci_set firewall local_node forward 'REJECT'
|
|
uci_commit firewall
|