Skip to content

Commit

Permalink
Merge pull request #9 from vahid-dan/main
Browse files Browse the repository at this point in the history
Fix ip/subnet
  • Loading branch information
vahid-dan authored Aug 31, 2023
2 parents 9dfa935 + 365652e commit b454c9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gateways/remote-access/lora-radio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sleep 1

case $lora_radio_mode in
"pendant")
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i $lora_radio_node_ip$lora_radio_node_netmask
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i "$lora_radio_node_ip""$lora_radio_node_netmask"
sudo /usr/sbin/tc qdisc add dev $lora_radio_lora_interface root tbf rate "$lora_radio_rate"kbit burst "$lora_radio_burst"kbit latency "$lora_radio_latency"ms
if ip route | grep -q default; then
sudo /usr/sbin/ip route delete default
Expand All @@ -49,12 +49,12 @@ case $lora_radio_mode in
;;

"noevio")
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i $lora_radio_node_ip
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i "$lora_radio_node_ip""$lora_radio_node_netmask"
sudo /usr/sbin/tc qdisc add dev $lora_radio_lora_interface root tbf rate "$lora_radio_rate"kbit burst "$lora_radio_burst"kbit latency "$lora_radio_latency"ms
;;

"noevio-nat")
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i $lora_radio_node_ip
sudo /usr/local/bin/tncattach /dev/$lora_radio_serial_interface $lora_radio_baud_rate -d -e -n -m $lora_radio_mtu -i "$lora_radio_node_ip""$lora_radio_node_netmask"
sudo /usr/sbin/tc qdisc add dev $lora_radio_lora_interface root tbf rate "$lora_radio_rate"kbit burst "$lora_radio_burst"kbit latency "$lora_radio_latency"ms
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
sudo /sbin/iptables -t nat -A POSTROUTING -o $lora_radio_uplink_interface -j MASQUERADE
Expand Down

0 comments on commit b454c9b

Please sign in to comment.