touchy slip of the tongue ... they're all peers, dear Watson.... which is the server and which are the peers
# apr/06/2022 13:29:26 by RouterOS 7.1.3
# software id = TI09-7WK3
#
/interface wireguard
add listen-port=1994 mtu=1420 name=wireguard
/interface lte apn
set [ find default=yes ] ip-type=ipv4
/ip pool
add name=VPN-Pool ranges=71.12.26.1,71.12.26.20
/port
set 0 name=serial0
set 1 name=serial1
/ppp profile
add local-address=xxx.xx2.230.10 name=VPN remote-address=VPN-Pool
set *FFFFFFFE change-tcp-mss=default local-address=xxx.xx2.230.10 \
remote-address=VPN-Pool
/interface l2tp-server server
set default-profile=VPN enabled=yes use-ipsec=yes
/interface ovpn-server server
set auth=sha1 certificate=server cipher=aes256 default-profile=VPN enabled=\
yes max-mtu=1450 port=1993 protocol=udp
/interface pptp-server server
set enabled=yes
/interface wireguard peers
add allowed-address=192.168.200.2/24 comment="My Mobile" endpoint-port=1994 \
interface=wireguard persistent-keepalive=25m public-key=\
"rQBcd3oa0fGFOGT/7opcVpikKdDSIyzbmUkO+OtjQT0="
add allowed-address=192.168.200.3/24 comment="My Laptop" endpoint-port=1994 \
interface=wireguard persistent-keepalive=25m public-key=\
"scX1P6qmPkULqxMPD8uraI8DUaI0nu0PDAt6M7Yv2Ew="
add allowed-address=192.168.200.4/24 comment="My PC" endpoint-port=1994 \
interface=wireguard persistent-keepalive=25m public-key=\
"Pv/ydw7HUac64j51rX36LNnzBdRPGcwblrj8F0u8pz0="
add allowed-address=192.168.200.5/24 comment=Saeed endpoint-port=1994 \
interface=wireguard persistent-keepalive=25m public-key=\
"NYBAmxnoDJ2Fxz1hUGCnvZXozFUBNTRx52r6dgb/61I="
/ip address
add address=xxx.xx2.230.10 interface=ether1 network=x.xx.65.254
add address=192.168.200.1/24 interface=wireguard network=192.168.200.0
/ip cloud
set update-time=no
/ip dns
set servers=8.8.8.8,1.1.1.1
/ip firewall filter
add action=accept chain=input comment=Winbpx dst-port=1993 protocol=tcp
add action=accept chain=input comment=VPN dst-port=\
1993,1945,1994,500,4500,1701 protocol=udp
add action=accept chain=input dst-port=1993,1945,1994,1723 protocol=tcp
add action=accept chain=input protocol=gre
add action=accept chain=input connection-state=established
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=input comment=Ping disabled=yes protocol=icmp
add action=drop chain=input comment=Protection
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=x.xx.65.254
/ip service
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set winbox port=1993
set api-ssl disabled=yes
/ip socks
set auth-method=password max-connections=10 port=1945 version=5
/ip socks users
add name=MxServer
add name=test
/ppp secret
add name=mehrdadvpn profile=VPN
add name=freshte.d profile=VPN
add name=mahtabvpn profile=VPN
add name=mom profile=VPN
add name=miss.faryadi profile=VPN
add name=hamidvpn profile=VPN
/system hardware
set allow-x86-64=yes
/system identity
set name=MxServer
/system ntp client
set enabled=yes
/system ntp client servers
add address=time.windows.com
/system package update
set channel=development
[Interface]
PrivateKey = CJNilywtZyH+1Dh/7kmexrce4wrH6ntvbKYkdL9LlFM=
ListenPort = 1994
Address = 192.168.200.4/24
DNS = 1.1.1.1
[Peer]
PublicKey = OWGLQysG/AfyjQJksOuzqlGWGrswyyAefzeLOYjsegQ=
AllowedIPs = 0.0.0.0/0
Endpoint = xxx.xxx.xxx.xx:1994
I ask for clarity for this very reason. The above text is gibberish and confuses the terms.my server is in France and i am using this server as a vpn server.
They are for peers behind NAT (and especially CGNAT).no the keep alives are not required on the WG settings !!!!!!!!!!
you right, openvpn port is 1993 and winbox is 1993 too, i must change one of them.This is rather bizarre for input chain rules.........
/ip firewall filter
add action=accept chain=input comment=Winbpx dst-port=1993 protocol=tcp
add action=accept chain=input comment=VPN dst-port=\
1993,1945,1994,500,4500,1701 protocol=udp
add action=accept chain=input dst-port=1993,1945,1994,1723 protocol=tcp
There are no forward chain rules??
Also not clear where the incoming wireguard traffic is going.........
Edit- okay its internet bound traffic.
Don't add those addresses in the allowed addresses, then.now i have another question, i want to exclude some network addresses from goings trough wiregaurd tunnel, can you help me ?
exactly! they are settings for and ON PEER devices, NOT peer settings on the MT server ;-PPThey are for peers behind NAT (and especially CGNAT).no the keep alives are not required on the WG settings !!!!!!!!!!
i want all traffic go trough tunnel except these networks: 192.168.80.0/24, 172.17.17.0/24Don't add those addresses in the allowed addresses, then.now i have another question, i want to exclude some network addresses from goings trough wiregaurd tunnel, can you help me ?
Or narrow down the allowed range, split it up in one or more parts, so the addresses you want to exclude, are not allowed ... thus excluded.
Or use FW rules. Maybe easier.
More then one way to skin that cat.
Maybe best you clarify in detail what should not be allowed to pass where.
A simple drawing perhaps ?
I agree that its possible but if the peer is behind NAt or CGnat or something else will it still work?? or trying to reach back to a laptop at a coffee shop?Not necessarily. The goal is to keep connection through NAT or firewall open, and whether it's done by packets from one side of the other doesn't matter.
Wait a second here.......... We described an MT server in France that you had several mobile devices attached that would use the internet of the MT through the wireguard tunnels.i want all traffic go trough tunnel except these networks: 192.168.80.0/24, 172.17.17.0/24
Don't add those addresses in the allowed addresses, then.
Or narrow down the allowed range, split it up in one or more parts, so the addresses you want to exclude, are not allowed ... thus excluded.
Or use FW rules. Maybe easier.
More then one way to skin that cat.
Maybe best you clarify in detail what should not be allowed to pass where.
A simple drawing perhaps ?
That was my concern, and the unknown behaviour of the MT side when no connection etc................@anav: When connection is open and needs just some packets flowing to keep open, direction of packets doesn't matter. But I think you're right, if it's mobile device, keepalives from server are not ideal, because if device connects from one place, server will be sending keepalives to there "forever" (I don't know if there's some timeout and it gives up after long enough silence from the other side; possibly could be, but I don't remember seeing it mentioned anywhere) until device connects again from somewhere else.
these networks are related to our office local network, if i connect to vpn then i cant access to these networksWait a second here.......... We described an MT server in France that you had several mobile devices attached that would use the internet of the MT through the wireguard tunnels.
i want all traffic go trough tunnel except these networks: 192.168.80.0/24, 172.17.17.0/24
Where do these subnets NEW ones 192.168.80.0/24 and 172.17.17.0/24 come from?? Where are they located??
For me this was already logical.That was my concern, and the unknown behaviour of the MT side when no connection etc................@anav: When connection is open and needs just some packets flowing to keep open, direction of packets doesn't matter. But I think you're right, if it's mobile device, keepalives from server are not ideal, because if device connects from one place, server will be sending keepalives to there "forever" (I don't know if there's some timeout and it gives up after long enough silence from the other side; possibly could be, but I don't remember seeing it mentioned anywhere) until device connects again from somewhere else.
Windows Client ?these networks are related to our office local network, if i connect to vpn then i cant access to these networks
Wait a second here.......... We described an MT server in France that you had several mobile devices attached that would use the internet of the MT through the wireguard tunnels.
Where do these subnets NEW ones 192.168.80.0/24 and 172.17.17.0/24 come from?? Where are they located??
You're so funny it hurts@holvoetn - interesting, not sure what you are getting at ref windows and ticks, did you leave the windows open and ticks are getting inside your house???
xxx.xx2.230.10 is server address in France and x.xx.65.254 is the GW. 192.168.200.1/24 is the ip address for wiregaurd interface, i dont know its useful in my case or notPerhaps in case its you who misunderstood then..................
The OP wants to from his client peer laptop to connect to the server in France via wireguard.
He wants to access the internet through his connection to France (not locally) and in addition he wants to access some subnets existing off the mikrotik in France.
The reason for both of our confusion is that in his config for France he never put in those subnets so we didnt know they existed. Rather unfair if you ask me.
/ip address
add address=xxx.xx2.230.10 interface=ether1 network=x.xx.65.254
add address=192.168.200.1/24 interface=wireguard network=192.168.200.0
where are they ????
++++++++++++++++++++++++++++++++++
If its the reverse he has not indicate a LOCAL OFFICE PEER, so if has one that is connecting to the SERVER in FRANCE, and if its a mikrotik device,
then he needs to come clean and give us that config as well. If its not a mikrotik device, then not our problem LOL...............
OR thirdly
information left out and he is making assumptions we know whats going on without a network diagram or full knowledge.
yes exactly.That is a client issue then and not germane to Mikrotik.
Thank you allviewtopic.php?t=180838
but modified for your particular needs.
which means add input chain rules and forward chain rules as necessary.