1 (edytowany przez chemik89 2025-03-18 12:08:55)

Temat: Proxmox + VMopenwrt +VPN wireguard

Cześć,
postanowiłem sobie wczoraj dorzucić na proxmoxie vm z openwrt która serwowałaby sieć dla innych kontenerów.
Na początek skonfigurowałem połącznie z protonVPN poprzez WG wedle instrukcji protona - wygląda na to że jest OK.

Problem mam za to z LAN openwrt<>VM oraz przekierowaniem portów do konkretnych VM (żeby dostać się do nich z normalnej sieci lokalnej)

sieć domowa 10.0.1.1
lan VM openwrt 11.0.1.1
wan VM openwrt 10.0.1.11

VM testowa z przeglądarką - 11.0.1.10

na VMopenwrt wan (10.0.1.11) wystawione porty 80,22 - mogę się więc normalnie wbić z sieci lokalnej.
próbuję jednak też przekierować usługę z 11.0.1.10:8090 na 10.0.1.11:8091 - ale ni w ząb nie daje rady

ponadto ze strony lan VM openwrt za chiny ludowe inne VM nie dostają adresu z DHCP vOpenwrt, statycznie działa.

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option mtu_fix '1'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config rule
        option src 'wan'
        option dest_port '80'
        option proto 'tcp'
        option target 'ACCEPT'

config rule
        option src 'wan'
        option dest_port '22'
        option proto 'tcp'
        option target 'ACCEPT'

config zone
        option name 'vpn'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        list network 'wgproton'

config forwarding
        option src 'lan'
        option dest 'vpn'

config rule
        option enabled '0'

config rule
        list proto 'tcp'
        option src 'wan'
        option target 'ACCEPT'
        option dest_port '8091'

config redirect
        option dest 'lan'
        option target 'DNAT'
        option name 'trr'
        option src 'wan'
        option src_dport '8091'
        option dest_ip '11.0.1.10'
        option dest_port '8090'
        option family 'ipv4'
        list proto 'tcp'
config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdc1:a55d:aa59::/48'
        option packet_steering '1'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'wan'
        option device 'eth1'
        option proto 'static'
        option ipaddr '10.0.1.11'
        option netmask '255.255.255.0'
        option gateway '10.0.1.1'
        list dns '10.2.0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '11.0.1.1'
        option netmask '255.255.255.0'
        list dns '11.0.1.1'
        option gateway '10.2.0.1'

config interface 'wgproton'
        option proto 'wireguard'
        option private_key ***
        list addresses '10.2.0.2/32'
        list dns '10.2.0.1'

config wireguard_wgproton
        option description 'Imported peer configuration'
        option public_key ***
        list allowed_ips '0.0.0.0/0'
        option endpoint_host '185.183.34.27'
        option endpoint_port '51820'
        option route_allowed_ips '1'
config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        option start '100'
        option limit '150'
        option leasetime '12h'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

2 (edytowany przez Cezary 2025-03-18 12:26:21)

Odp: Proxmox + VMopenwrt +VPN wireguard

Stawiałem sobie openwrt na proxmoxie i jakoś naturalnie eth0 który był dołączony do domyślnego bridga od proxmoxa pozwalał na uzyskiwanie adresów przez inne maszyny w wirtualnach. Jakoś tak prostu, bez zastanawiania się czy działa czy jest problem.

Pokaż jak to w proxmoxie połączyłeś.

        option gateway '10.0.1.1'
        list dns '10.2.0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '11.0.1.1'
        option netmask '255.255.255.0'
        list dns '11.0.1.1'
        option gateway '10.2.0.1'

To jest zbdurą. Po co dwa gaetwaya na lanie i wan?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez chemik89 2025-03-18 12:34:20)

Odp: Proxmox + VMopenwrt +VPN wireguard

10.2.0.1 to gtw protonaVPN

https://i.ibb.co/xK9q739t/Zrzut-ekranu-2025-03-18-123302.png https://i.ibb.co/jN69ySd/Zrzut-ekranu-2025-03-18-123238.png https://i.ibb.co/YCQHB8B/Zrzut-ekranu-2025-03-18-123220.png https://i.ibb.co/DHZz06X7/Zrzut-ekranu-2025-03-18-123201.png

4

Odp: Proxmox + VMopenwrt +VPN wireguard

Ale to i tak ideologocznie jest dziwne.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez chemik89 2025-03-18 12:41:20)

Odp: Proxmox + VMopenwrt +VPN wireguard

wydawało sie sensowne, WAN to tak na prawdę moja siec lokalna, bramą jest więc mój główny router, a nie VPN ...
LAN dla VM ma być odcięty i cały ruch przechodzić przez VPN.

ale tak czy siak nie to raczej rodzi problem z przekierowaniem portu z VM czy brak dhcp (puppy)
jeszcze postawie jakiś inny live na testy.

6

Odp: Proxmox + VMopenwrt +VPN wireguard

no dobra, na mincie dhcp działa, puppy chyba tylko taki upośledzony.

to teraz ten route portu

7

Odp: Proxmox + VMopenwrt +VPN wireguard

zmieniłem gtw oba na 10.0.1.1
teraz na porcie 8091 mam
Failed to load resource: the server responded with a status of 401 (Unauthorized)

huh, w sieci lan http://11.0.1.10:8090 działa OK.

8

Odp: Proxmox + VMopenwrt +VPN wireguard

Więc masz tam coś co nasłuchuje z sieic lokalnej (dla niego) a nie wpuszcza innych podsieci.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9 (edytowany przez chemik89 2025-03-18 17:11:04)

Odp: Proxmox + VMopenwrt +VPN wireguard

huh zapore na windowsie wylaczylem nawet już z braku laku.
nie wiem co tam jszcze moze byc, już portami strzelam w świat.
z poziomu sieci lokalnej 10.*
GET http://10.0.1.11:61666/ 401 (Unauthorized)

http://10.0.1.11:80 jest ok, luci.
22 ssh też ok.

z poziomu lan 11.*
to samo
GET http://10.0.1.11:61666/ 401 (Unauthorized)
http://11.0.1.10:8090 OK

chatgpt też zaręcza że musi działać ;D


hmm, może z samym qbittorrent jest coś *&*
WEBUI_PORT variable¶
Due to issues with CSRF and port mapping, should you require to alter the port for the web UI you need to change both sides of the -p 8080 switch AND set the WEBUI_PORT variable to the new port.

For example, to set the port to 8123 you need to set -p 8123:8123 and -e WEBUI_PORT=8123

10

Odp: Proxmox + VMopenwrt +VPN wireguard

nie masz czegoś takiego: https://imgur.com/zuMucuQ ?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

11

Odp: Proxmox + VMopenwrt +VPN wireguard

teraz to już nawet neta nie mam big_smile a przywróciłem cały config.

12 (edytowany przez chemik89 2025-03-21 22:45:13)

Odp: Proxmox + VMopenwrt +VPN wireguard

huh bo już zgłupiałem z tymi firewallami big_smile

na 11.0.1.10 chciałbym się dostać do SAMBy serwowanej z 10.0.1.20

jak zrobić do tego routing ? ;D

z chatagpt wycisnąłem to big_smile

uci add firewall rule
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='11.0.1.10'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_ip='10.0.1.20'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='445'
uci set firewall.@rule[-1].target='ACCEPT'
Allow UDP port 137 (NetBIOS name service):

uci add firewall rule
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='11.0.1.10'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_ip='10.0.1.20'
uci set firewall.@rule[-1].proto='udp'
uci set firewall.@rule[-1].dest_port='137'
uci set firewall.@rule[-1].target='ACCEPT'

Allow UDP port 138 (NetBIOS datagram service):

uci add firewall rule
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='11.0.1.10'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_ip='10.0.1.20'
uci set firewall.@rule[-1].proto='udp'
uci set firewall.@rule[-1].dest_port='138'
uci set firewall.@rule[-1].target='ACCEPT'

Allow UDP port 139 (NetBIOS session service):

uci add firewall rule
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].src_ip='11.0.1.10'
uci set firewall.@rule[-1].dest='wan'
uci set firewall.@rule[-1].dest_ip='10.0.1.20'
uci set firewall.@rule[-1].proto='udp'
uci set firewall.@rule[-1].dest_port='139'
uci set firewall.@rule[-1].target='ACCEPT'

i wyglada ze nawet moze dzialac ;D


śmiga.