View Single Post
Nummer 2 fungerer med en liten modifikasjon:

iptables -t nat -A PREROUTING -i ens33:0 -j DNAT --to 10.66.66.2

Nå, når jeg ssh'er maskiner på lokalnettverket, så oppgir den at
trafikken kommer fra 192.168.0.31 .

Men jeg får fortsatt ikke en rute tilbake til sky maskinen fra lokal-nettverket.
Når jeg ssh'er 192.168.0.31 så kommer jeg bare til wireguard serveren, ikke til sky-serveren.

root@pyro-nvme:~# ifconfig wg0
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 10.66.66.2 netmask 255.255.255.255 destination 10.66.66.2
inet6 fd42:42:42::2 prefixlen 128 scopeid 0x0<global>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 260 bytes 42256 (41.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 400 bytes 51336 (50.1 KiB)
TX errors 0 dropped 7 overruns 0 carrier 0 collisions 0

root@pyro-nvme:~# ssh pyro@192.168.0.189
pyro@192.168.0.189's password:
___ _ _ _ __ ___ _ _ _
/ _ \ __| |_ __ ___ (_) __| | \ \/ / | | | || |
| | | |/ _` | '__/ _ \| |/ _` | \ /| | | | || |_
| |_| | (_| | | | (_) | | (_| | / \| |_| |__ _|
\___/ \__,_|_| \___/|_|\__,_| /_/\_\\___/ |_|

Welcome to Armbian 20.08.5 Buster with Linux 5.4.65-odroidxu4

System load: 1% Up time: 59 days 9:38
Memory usage: 10% of 1.94G IP: 192.168.0.189 192.168.0.189
CPU temp: 58°C Usage of /: 9% of 30G

[ General system configuration (beta): armbian-config ]

Last login: Sun Nov 29 12:49:13 2020 from 192.168.0.31
pyro@xu4:~$ env | grep SSH
SSH_CONNECTION=192.168.0.31 58298 192.168.0.189 22
SSH_CLIENT=192.168.0.31 58298 22
SSH_TTY=/dev/pts/2
pyro@xu4:~$ ssh 192.168.0.31
pyro@192.168.0.31's password:
Linux wireguard 5.8.0-0.bpo.2-amd64 #1 SMP Debian 5.8.10-1~bpo10+1 (2020-09-26) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Nov 29 11:12:37 2020 from 192.168.0.199
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
pyro@wireguard:~$ ifconfig wg0
-bash: ifconfig: command not found
pyro@wireguard:~$ sudo ifconfig wg0
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420
inet 10.66.66.1 netmask 255.255.255.0 destination 10.66.66.1
inet6 fd42:42:42::1 prefixlen 64 scopeid 0x0<global>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 281 bytes 37024 (36.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 203 bytes 33940 (33.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

pyro@wireguard:~$
Vis hele sitatet...
Jeg setter stor pris på hjelpen din

Edit timeren gikk ut, quoten ble litt stygg of uoversiktlig, så her er i bilde format:
Sist endret av Pyro_Killer; 29. november 2020 kl. 13:00. Grunn: Automatisk sammenslåing med etterfølgende innlegg.