From 9004e1739d7cb288e1afaadd7c9ecf430e9d3c59 Mon Sep 17 00:00:00 2001
From: sspark <sspark@onioi.com>
Date: Wed, 23 Aug 2023 05:55:41 +0000
Subject: [PATCH] fix roaming gateway issue

---
 README.md |  100 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 99 insertions(+), 1 deletions(-)

diff --git a/README.md b/README.md
index b8a913a..b9fb3e1 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 
 option
 -> SSH enable
--> wifi country GB
+-> wifi country KR
 -> locale Asia/Seoul
 
 ### get gw install script from git server ##
@@ -55,6 +55,21 @@
 
 ```
 
+### Change sshd_config ###
+
+```
+sudo vi /etc/ssh/sshd_config
+
+```
+
+```
+AllowTcpForwarding yes
+GatewayPorts yes
+```
+
+```
+sudo service ssh restart
+```
 
 ### Check server side RPi4 SSH tunnel port ###
 
@@ -96,6 +111,17 @@
 
 ```
 
+kernel header issue ( Error! DKMS tree already contains: 8812au-5.6.4.2_35491.20191025 )
+```
+sudo apt-get upgrade
+sudo reboot
+sudo apt install build-essential libelf-dev linux-headers-$(uname -r)
+sudo dkms status
+sudo dkms remove 8812au/5.6.4.2_35491.20191025 --all
+sudo dkms status
+sudo make dkms_install
+```
+
 ### RPi4 internal WiFi disable & USB WiFi enable wlan0 ###
 
 /boot/config.txt
@@ -122,6 +148,78 @@
 vcgencmd measure_temp
 ```
 
+### RPi 4 SD Card wifi setting ###
+
+Put the wpa_supplicant.conf file with the following contents in /boot folder of the sd card.
+When the setting is completed, the x file will be deleted from the /boot folder of the sd card.
+
+```
+country=KR # Your 2-digit country code
+ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
+
+network={
+    ssid="wifi ssid"
+    psk="widi passwd"
+}
+
+```
+
+
+### WireGuard ###
+
+```
+sudo apt install wireguard
+sudo vi /etc/wireguard/wg0.conf
+sudo vi /etc/network/interfaces.d/wg0
+sudo ifup wg0
+ip route get 10.8.0.1
+ping -c 3 10.8.0.1
+sudo wg show wg0
+```
+
+/etc/wireguard/wg0.conf
+```
+[Interface]
+PrivateKey =  
+#Address = 10.8.0.2/24
+#DNS = 1.1.1.1
+#MTU = 1420
+
+[Peer]
+PublicKey =  
+PresharedKey =  
+AllowedIPs = 192.168.1.0/24, 10.8.0.0/24
+PersistentKeepalive = 30
+Endpoint = vp.onioi.com:51888
+```
+
+/etc/network/interfaces.d/wg0
+```
+# indicate that wg0 should be created when the system boots, and on ifup -a
+auto wg0
+
+# describe wg0 as an IPv4 interface with static address
+iface wg0 inet static
+
+        # the IP address of this client on the WireGuard network
+        address 10.8.0.2/24
+
+        # before ifup, create the device with this ip link command
+        pre-up ip link add $IFACE type wireguard
+
+        # before ifup, set the WireGuard config from earlier
+        pre-up wg setconf $IFACE /etc/wireguard/$IFACE.conf
+
+        # after ifdown, destroy the wg0 interface
+        post-down ip link del $IFACE
+```
+
+
+### update gateway ###
+
+```
+curl "https://onioi.com:8443/zip/?r=MEDILOGIS/gwinstall.git&p=dist&h=master&format=gz" -k -o dist.tar.gz
+```
 
 ### TODO ###
  

--
Gitblit v1.9.3