26

(34 odpowiedzi, napisanych Debian Mini HowTo)

Wracając do tematu, to mam skonfigurowany interfejs:

auto eth1
iface eth1 inet manual

auto br0
iface br0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        bridge_ports eth1 tap0

Klient się łączy z serwerem OVPN, ale nie przydziela mu adresów IP z serwera DHCP.
Aby taki adres uzyskać muszę ręcznie uruchomić poniższe polecenia, wtedy dostaje adres i jest fajnie.
Problem jest jeszcze jeden, mimo, iż jest w sieci LAN, to nie widzi innych adresów i nie ma internetu sad
Cezary pomożesz ?

openvpn --mktun --dev tap0
brctl addif br0 tap0
ifconfig tap0 0.0.0.0 promisc up

Robiłem jak w poście: https://eko.one.pl/?p=openwrt-openvpn

iptables:

iptables -I INPUT -p udp -m udp --dport 1194 -j ACCEPT
iptables -I INPUT -i tap+ -j ACCEPT
iptables -I FORWARD -o tap+ -j ACCEPT
iptables -I FORWARD -i tap+ -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

27

(34 odpowiedzi, napisanych Debian Mini HowTo)

Jestem na wielu forach, ale z taką dyspozycyjnością i odpowiedziami, to kładziesz wszystkich na kolana ;P
To Twoja strona:  https://cezaryjackiewicz.pl/ ?

28

(34 odpowiedzi, napisanych Debian Mini HowTo)

Dzięki Cezary.
A tak z innej parafii, tak się czasem zastanawiam, ile osób kryje się pod tym nickiem "Cezary" ? smile

29

(34 odpowiedzi, napisanych Debian Mini HowTo)

Chcę mieć dostęp do sieci lokalne i aby klient dostawał IP z serwera DHCP, który w tej sieci jest.

30

(34 odpowiedzi, napisanych Debian Mini HowTo)

Jeśli zrobię tak: bridge_ports eth1 tap0 - to będę miał dostęp do sieci lokalnej, a jak dodam tylko tap0 ?

31

(34 odpowiedzi, napisanych Debian Mini HowTo)

Cezary napisał/a:

I jeszcze bridge_ports jeżeli nie chcesz dodawać ręcznie interfejsów do bridge.

]auto br0
iface br0 inet static
        address 192.168.1.16
        netmask 255.255.255.0
        network 192.168.1.0
        bridge_ports [a co mam tu wpisać - tap0?]

32

(34 odpowiedzi, napisanych Debian Mini HowTo)

Czyli po prostu  tak ?

auto br0
iface br0 inet static
        address 192.168.1.16
        netmask 255.255.255.0
        network 192.168.1.0

33

(34 odpowiedzi, napisanych Debian Mini HowTo)

Coś takiego ?

auto br0
iface br0 inet manual
bridge_ports eth0 eth1

auto tap0
allow-hotplug tap0
iface tap0 inet static
        address 192.168.1.16
        netmask 255.255.255.0
        network 192.168.1.0
        bridge_ports br0

34

(34 odpowiedzi, napisanych Debian Mini HowTo)

Mam coś takiego na Debian11 na innym Debianie mi działa. Co to może być ?

root@deb:/etc/openvpn# brctl addif eth1 tap0
can't add tap0 to bridge eth1: Operation not supported

35

(34 odpowiedzi, napisanych Debian Mini HowTo)

Muszę mieć klientów po statycznych adresach.
A skąd klient ovpn będzie wiedział, że dany adres statyczny wydzielony na serwerze dhcp jest dla niego ?

36

(34 odpowiedzi, napisanych Debian Mini HowTo)

Ok, a jak uzyskać stateczny adres IP, jaki zapis musi być w configu na kliencie np. Win10 ?

37

(2 odpowiedzi, napisanych Debian Mini HowTo)

Dziękuję mam. Już działa.

38

(2 odpowiedzi, napisanych Debian Mini HowTo)

Cześć, mam mały problem, nie mogę uzyskać adresu IP z puli dhcp routera na kliencie (win10).
Robiłem konfigurację wg poradnika:

https://eko.one.pl/?p=openwrt-openvpn


Błędów żadnych nie widzę...

Log z Win10

Mon Mar 06 22:15:52 2023 OpenVPN 2.1.4 i686-pc-mingw32 [SSL] [LZO2] [PKCS11] built on Nov  8 2010
Mon Mar 06 22:15:52 2023 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Mon Mar 06 22:15:52 2023 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Mar 06 22:15:52 2023 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Mar 06 22:15:52 2023 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Mar 06 22:15:52 2023 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Mar 06 22:15:52 2023 Socket Buffers: R=[65536->65536] S=[65536->65536]
Mon Mar 06 22:15:52 2023 TAP-WIN32 device [ovpn] opened: \\.\Global\{B84A3953-8833-47AF-A786-3F86D32A91AF}.tap
Mon Mar 06 22:15:52 2023 TAP-Win32 Driver Version 9.7 
Mon Mar 06 22:15:52 2023 TAP-Win32 MTU=1500
Mon Mar 06 22:15:52 2023 Successful ARP Flush on interface [50] {B84A3953-8833-47AF-A786-3F86D32A91AF}
Mon Mar 06 22:15:52 2023 Data Channel MTU parms [ L:1576 D:1450 EF:44 EB:4 ET:32 EL:0 ]
Mon Mar 06 22:15:52 2023 Local Options hash (VER=V4): '8b888ddc'
Mon Mar 06 22:15:52 2023 Expected Remote Options hash (VER=V4): '8b888ddc'
Mon Mar 06 22:15:52 2023 UDPv4 link local: [undef]
Mon Mar 06 22:15:52 2023 UDPv4 link remote: 46.186.11.11:1194

Po dłuższej chwili łączy się, ale brak adresu IP.

39

(34 odpowiedzi, napisanych Debian Mini HowTo)

A czy by ktoś by mnie uraczył jakąś poprawną konfiguracją OVPN bez certyfikatów tylko na hasło pod Debiana11 ?
Oczywiście OVPN jako bridge. Bo nie wiem, jak się do tego zabrać. Czytałem trochę poradników, ale są one nie do końca ok.
Tu jak ktoś coś wrzuca, to po prostu to działa.
Z góry bardzo dziękuję

40

(34 odpowiedzi, napisanych Debian Mini HowTo)

A podrzuciłbyś chętnie był zobaczył.
A czy wydajność ovpna z certyfikatami i hasłem jest taka sama ? Czy z tylko z hasłem większa ?

41

(34 odpowiedzi, napisanych Debian Mini HowTo)

Tak, ale OVPN jest wolniejszy i trzeba te certyfikaty tworzyć.
A chciałbym, aby końcowy użytkownik który na tym się nie zna poradził sobie z uruchomieniem clienta.

42

(34 odpowiedzi, napisanych Debian Mini HowTo)

Cześć, chciałbym się Was doradzić, jak to zrobić...
Mam server: Debian11, który jest firewallem opartym na iptables.
Interfejsy:

WAN 150.240.222.010
LAN 192.168.1.1
DHCP 192.168.1.50-192.168.1.200
Wydzielona pula adresów dla VPNa [192.168.1.150-192.168.1.200]

Chciałbym łączyć się z tym serwerem przez wireguarda, ale tak żeby dostawać adresy z dhcp servera.
Da się coś takiego zrobić ? I aby sam server wireguarda miał też adres (statyczny) z puli DHCP servera.

Cześć, czy dysponuje może ktoś jakimś skryptem do sprawdzania połączenia między klientem a serwerem wireguard, a w przypadku braku połączenia restartuje interfejs i sprawdza, czy nawiązano je połączenie? Wysyłanie jeszcze maila do tego było by kosmosem smile

44

(13 odpowiedzi, napisanych Inne)

Hehe
W niektórych przypadkach lepiej mi chodzi, jak ustawię redirect niż rules...

root@OpenWrtCBK:~# uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@defaults[0].synflood_protect='1'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[0].network='lan'
firewall.@zone[1]=zone
firewall.@zone[1].name='wan'
firewall.@zone[1].input='REJECT'
firewall.@zone[1].output='ACCEPT'
firewall.@zone[1].forward='REJECT'
firewall.@zone[1].masq='1'
firewall.@zone[1].mtu_fix='1'
firewall.@zone[1].network='wan' 'lte'
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src='lan'
firewall.@forwarding[0].dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@redirect[0]=redirect
firewall.@redirect[0].target='DNAT'
firewall.@redirect[0].name='wol'
firewall.@redirect[0].proto='udp'
firewall.@redirect[0].src='wan'
firewall.@redirect[0].dest='lan'
firewall.@redirect[0].src_dport='9'
firewall.@redirect[0].dest_port='9'
firewall.@redirect[0].src_port='9'
firewall.@redirect[0].dest_ip='192.168.10.11'
firewall.@redirect[1]=redirect
firewall.@redirect[1].target='DNAT'
firewall.@redirect[1].proto='tcp'
firewall.@redirect[1].src='wan'
firewall.@redirect[1].src_dport='443'
firewall.@redirect[1].dest='lan'
firewall.@redirect[1].dest_ip='192.168.10.12'
firewall.@redirect[1].dest_port='443'
firewall.@redirect[1].name='Cloud443'
firewall.@redirect[2]=redirect
firewall.@redirect[2].target='DNAT'
firewall.@redirect[2].name='Cloud80'
firewall.@redirect[2].proto='tcp'
firewall.@redirect[2].src='wan'
firewall.@redirect[2].src_dport='80'
firewall.@redirect[2].dest='lan'
firewall.@redirect[2].dest_ip='192.168.10.12'
firewall.@redirect[2].dest_port='80'
firewall.@redirect[3]=redirect
firewall.@redirect[3].target='DNAT'
firewall.@redirect[3].name='RDP'
firewall.@redirect[3].proto='tcp'
firewall.@redirect[3].src='wan'
firewall.@redirect[3].src_dport='1986'
firewall.@redirect[3].dest='lan'
firewall.@redirect[3].dest_ip='192.168.10.11'
firewall.@redirect[3].dest_port='1986'
firewall.@redirect[4]=redirect
firewall.@redirect[4].target='DNAT'
firewall.@redirect[4].proto='tcp'
firewall.@redirect[4].src='wan'
firewall.@redirect[4].src_dport='5118'
firewall.@redirect[4].dest='lan'
firewall.@redirect[4].dest_ip='192.168.10.12'
firewall.@redirect[4].dest_port='5118'
firewall.@redirect[4].name='SSH_Cloud'
firewall.@redirect[5]=redirect
firewall.@redirect[5].target='DNAT'
firewall.@redirect[5].proto='udp'
firewall.@redirect[5].src='wan'
firewall.@redirect[5].src_dport='51825'
firewall.@redirect[5].dest_port='51825'
firewall.@redirect[5].name='WG'
firewall.@redirect[5].dest_ip='10.10.11.1/32'
firewall.@redirect[5].dest='vpn'
firewall.@redirect[5].enabled='0'
firewall.@zone[2]=zone
firewall.@zone[2].name='vpn'
firewall.@zone[2].masq='1'
firewall.@zone[2].input='ACCEPT'
firewall.@zone[2].output='ACCEPT'
firewall.@zone[2].forward='REJECT'
firewall.@zone[2].network='wg_server'
firewall.@forwarding[1]=forwarding
firewall.@forwarding[1].src='lan'
firewall.@forwarding[1].dest='vpn'
firewall.@forwarding[2]=forwarding
firewall.@forwarding[2].src='vpn'
firewall.@forwarding[2].dest='wan'
firewall.@rule[9]=rule
firewall.@rule[9].name='wg'
firewall.@rule[9].target='ACCEPT'
firewall.@rule[9].proto='udp'
firewall.@rule[9].src_port='51825'
firewall.@rule[9].dest_port='51825'
firewall.@rule[9].src='wan'
firewall.@rule[9].dest='vpn'
firewall.@rule[10]=rule
firewall.@rule[10].name='wg'
firewall.@rule[10].target='ACCEPT'
firewall.@rule[10].proto='all'
firewall.@rule[10].src='vpn'
firewall.@rule[10].dest='lan'

45

(13 odpowiedzi, napisanych Inne)

Na innym routerze mam coś takiego, czy jest to ok [zakładka Traffic Rules] ?
Działać działa, ale czy jest wg sztuki...
https://i.ibb.co/jDxDj33/11.png

46

(13 odpowiedzi, napisanych Inne)

Cezary napisał/a:

Powienienieś mieć otworzenie portu (rule) a nie redirect. Miałeś?

Nie.
Wszystko robiłem w zakładce Port Forwards. A jaka jest różnica między Port Forwards a Traffic Rules ?
Bo w sumie i tu i tu działa...

47

(13 odpowiedzi, napisanych Inne)

No to klops...
Jutro wizyta u klienta, bo teraz nie mogę się połączyć. Dodałem option masq '1' i usunąłem sekcje redirect.
No cóż nie zawrze idzie po dobrej myśli.
Dziękuję Ci Cezary i tak...

48

(13 odpowiedzi, napisanych Inne)

Cezary napisał/a:

W allowedips w serwerze nie masz wskazanej klasy adresowej za lanem.

Cezary dziękuję Ci za wskazówkę, ale czy mógłbyś mi to bardziej wyjaśnić co gdzie wpisać, bo nie kumam za bardzo ? sad
Coś takiego ?

config interface 'wg_server'
        option proto 'wireguard'
        option private_key 'cO...='
        option listen_port '51820'
        list addresses '10.8.0.1/32'
        list allowed_ips '192.168.0.0/24'

https://i.ibb.co/M1GVw4M/11.png

Jeśli to co powyżej jest ok, to ping dalej nie działa. Firewall na Windowsie wyłączony.

C:\Windows\System32>ping 192.168.0.192

Pinging 192.168.0.192 with 32 bytes of data:
Reply from 10.8.0.1: Destination port unreachable.
Reply from 10.8.0.1: Destination port unreachable.
Reply from 10.8.0.1: Destination port unreachable.

49

(13 odpowiedzi, napisanych Inne)

Łącze się z Win10. Mój klient wygląda tak:

[Interface]
PrivateKey = gE...=
ListenPort = 51820
Address = 10.8.0.4/32
DNS = 1.1.1.1

[Peer]
PublicKey = kO...8=
AllowedIPs = 10.8.0.1/24, 192.168.0.0/24
Endpoint = 40.20.100.100:51820
PersistentKeepalive = 25

50

(13 odpowiedzi, napisanych Inne)

Cześć, mam problem z którym nie mogę sobie poradzić.
Mam router LINKSYS_MR8300, na którym jest server VPN (wireguard).
Router 192.168.0.1
Wireguard: 10.8.0.1

Chciałbym klientami mieć dostęp do całej sieci lokalnej. Obecnie klient01 pinguje tylko adres 192.168.0.1.
Czy mam coś źle skonfigurowane ?
Bardzo bym prosił o pomoc

logi configów

root@LINKSYS_MR8300:~# cat /etc/config/network
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 'fdb0:e37c:52ac::/48'

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

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.0.1'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 0'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 0'

config interface 'wg_server'
        option proto 'wireguard'
        option private_key 'cO...'
        option listen_port '51820'
        list addresses '10.8.0.1/32'

config wireguard_wg_server
        option public_key 'Xa...'
        option description 'klient01'
        list allowed_ips '10.8.0.0/24'
        option route_allowed_ips '1'

config wireguard_wg_server
        option description 'klient02'
        option public_key 'C6...'
        list allowed_ips '10.8.0.0/24'
        option route_allowed_ips '1'

config wireguard_wg_server
        option description 'admin'
        option public_key 'MT...'
        option route_allowed_ips '1'
        list allowed_ips '10.8.0.0/24'
root@LINKSYS_MR8300:~# cat /etc/config/firewall

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

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

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

config forwarding
        option src 'lan'
        option dest 'wan'

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 name 'WG'
        option src 'vpn'
        option dest 'lan'
        option target 'ACCEPT'
        list dest_ip '192.168.0.0/24'

config zone
        option name 'vpn'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        list network 'wg_server'

config redirect
        option dest 'lan'
        option target 'DNAT'
        option name 'WG'
        list proto 'udp'
        option src 'wan'
        option src_dport '51820'
        option dest_ip '10.8.0.1/32'
        option dest_port '51820'

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

config forwarding
        option src 'vpn'
        option dest 'wan'