Thanks for the reply.NAT hides multiple addresses behind one and it works for outgoing connections. But if there's incoming connection to external address, router must decide where to send it. With NAT 1:1, everything to external address is sent to one internal address. Ports stay the same, only destination address changes, it's easy. UPnP is for selected ports. So internal device A tells router that it needs ports a, b, c forwarded to it, device B tell router that it needs x, y, z. And it also works, because if incoming connection is to port a, it goes to device A, if for port x, it goes to device B, also easy.
[...]
Yes, probably I haven't made me clear. The context is online gaming. PSN/XBOX sets NAT Type based on the network. If I connect the PS4/XBOX directly to the modem, they receive NAT Type 1 and in-game Nat Open.I understand what you want. But think about poor router. It has one external address, let's say 1.2.3.4. If a new connection comes to e.g. 1.2.3.4:5678, how can it know if it should send it to internal 192.168.88.10, 192.168.88.20, or some other one? It can't. It's like wanting to hit two completely different targets with one bullet.
The thing is that I cannot open all ports to a few clients. If I assign Netmap to a client, I lose VPN of my MT and that's not the case.edit removed
Good question, what is going on with MT NAT that is different from a consumer router that just works for this scenari0?
I am thinking the extra granularity of MT should provide a config that works!!
Hi,Do you say that when you connect two consoles to the modem directly (i.e. without Mikrotik in between the modem and the consoles) at the same time, both consoles indicate the same NAT type "open" and you can use both simultaneously (with two players playing the same online game each on one of those two consoles)?
A1: The gaming console should connect to internet just fine with a router even if assigned a private IP. Opened ports (directly to the modem) works best.Good question Sindy, are you trying to establish if one gaming console is being used or two being used at the same time?
Q1: Does one gaming console work with normal consumer router to modem (or isp supplied combo router/modem)?
Q2: Do two gaming consoles work at the same time with normal consumer router to modem (or isp supplied combo router/modem)?
Q3: Does one gaming console work with MT router?
Q4: Do two gaming consoles work at the same time with the MT router?
Q5: In any scenario where both consoles are connected at the same time, are players at each console able to play the same game concurrently (online)?
No need for VPN. MT > Linksys Router > PS4.So you want Mikrotik to forward packets coming to its public address to the private one of the console on the LAN, but choose the right one depending on which console is connected at the time?
Because the DMZ approach (1:1 NAT) should be enough to make the console think that the NAT is the "open" type, and the private address can be updated using a script whenever one of the consoles gets an address from Tik's DHCP server. And the VPN access can be preserved using exceptions from the 1:1 dst-nat rule for the ports used for the VPN, unless the console uses the very same ports for its own purposes.
That is why I asked about two PS4s used simultaneously. You said you need just one PS4 but at the same time you say you need two clients in DMZ.The problem is when I need more than one client in DMZ.
I agree.That is why I asked about two PS4s used simultaneously. You said you need just one PS4 but at the same time you say you need two clients in DMZ.The problem is when I need more than one client in DMZ.
In NAT environment, 1:1 NAT is the best approximation of a DMZ you can get. When a device on a private IP checks how the NAT behaves in particular, it checks with the server whether the server has received the initial request for a connection from the same port from which the client has sent it; this is what Mikrotik normally does unless another client device sends a request to the same remote socket from the same port, as in such case, all the fields used to identify a connection (address:port of the server and address:port of the Mikrotik's WAN) would be identical for both connections so it would not be possible to decide to which of the two connection a packet received at WAN belongs.
For incoming communication requests, where the device on a private side of the NAT acts as a server, the situation is even more hopeless - the address of the remote client cannot be used to choose the required one out of the two addresss on the private side, so you simply cannot have more than a single device in DMZ behind a NAT unless each of them would listen on a different set of ports.
That router is remotely connected through a wireless CPE so, it is necessary to have a router because that CPE is bridged and the end user needs to connect multiple devices.Introducing a second router in the mix is I suspect going to be problematic regardless of which user console is going to be used..........
Have you tried connecting the consoles directly to the MT router??
If you mean an address list of the sources in the internet, then yes. You can forward packets for wan.add.re.ss:port to private.add.ress.1:port if they come from a source on address-list "list1", and to private.add.ress.2:port if they come from a source on address-list "list2", and to private.add.ress.3:port if they come from a source which is not on any address list.Can this be bypassed by having an address list to DMZ?
Thanks Sindy for giving your opinion in this topic. Probably, we have gone so deep into this and I would like to clarify the main point here.If you mean an address list of the sources in the internet, then yes. You can forward packets for wan.add.re.ss:port to private.add.ress.1:port if they come from a source on address-list "list1", and to private.add.ress.2:port if they come from a source on address-list "list2", and to private.add.ress.3:port if they come from a source which is not on any address list.Can this be bypassed by having an address list to DMZ?
Or you can forward the packets to private address chosen up to the destination port.
But you cannot decide which of the three internal addresses to choose if you do not know in advance on which port it listens (or if all of them listen on the same port) or from where the request will come.
It is not a matter of configuration, it is a matter of common sense. If you do not have any information in the packet itself which would tell you where to send it, there is nothing you could use to choose a forwarding (dst-nat) rule.
But I am still wondering about your overall topology. Do the PS4 games send packets between players directly, i.e. not via a gaming server? Because the only scenario I can imagine where you need a real DMZ is that you have two PS4s behind the same public IP, and a third one behind another public IP, and they all participate in the same game to the third one needs to send direct packets to both the first and second one. Only in this case there is a conflict because when the first PS4 seizes a particular port on the public IP of the WAN interface for a connection with the third one, the second PS4 cannot seize the same port for connection with the third one because the packets coming from the third PS4 to that port would be forwarded to the first console.
So maybe we were not clear enough in the example with two PS4, where you want to have one connected directly to Mikrotik's LAN and the other one connected to the LAN of the Linksys but it also gets to internet via the same Mikrotik like the first one, and we've simplified it to just 2 PS4 on Mikrotik's LAN, approximating the tunnel via Linksys by just a cable?
For a single client that's no issue, the dst-nat rule may translate just the destination address and ignore protocol & port completely. So instead of specifying dst-port=1-65535, just leave the dst-port out from the rule completely, much like the default action=masquerade rules in chain=srcnat do. And this way, you can have a triple and quadruple NAT and still nothing happens.How can we have all ports open for a given client? That's the issue.
That is a very likely scenario. I'd like to have my consoles with all ports open. There are 3 and that's the problem.If you'd have:
MT>Router>(PS4#1,PS4#2,...)
then NAT 1:1 from MT to Router and UPnP on Router should work fine (edit: although maybe not, I'm not sure if client gets public address from UPnP server, it wouldn't be public in this case, if it does). But if it would be anything like:
MT>Router1>PS4#1
MT>Router2>PS4#2
MT>PS4#3
i.e. not all consoles behind same router, it's probably impossible. You'd either need to configure consoles to each use different port range and configure such port forwarding on routers (I have no idea if it's possible; probably not, because average user would not be able to configure it anyway). Or there would have to be some UPnP proxy on Router that would receive requests from clients, open ports as usual, and additionally send own UPnP port opening request to upstream router. I don't know if anything supports this (RouterOS surely doesn't).
That's why I talked about a single PS4 connected directly on Mikrotik's LAN (and with UPnP disabled); if it works to your satisfaction, Mikrotik's handling of 1:1 NAT is not the issue. Have you tried this simplified scenario as a diagnostic step?How can we have all ports open for a given client? That's the issue.
When that is done (UPnP: Off), PS4 shows NAT restricted.
A single PS4 behind a Mikrotik and Linksys, each with 1:1 NAT configured, should also not be an issue even with UPnP disabled.
Could you please explain a little bit more of 1:1? Is that for a single device or for the entire LAN? How is that done?
Two PS4 (or one PS4 and something else talking to the same remote services) behind the same public IP will always be a problem no matter whether directly on Mikrotik's (or any other NATing router's) LAN or behind yet another 1:1 NAT device.
Well, the MT is handling a public IP dynamically for worse so I have auto routes.
Unfortunately, there is no IPv6 yet in here.
Then you should be able to install it. I don't know if such thing exists, but the idea is logical and not even complicated (well, on first sight at least). So try to look around, maybe you'll be lucky.Or there would have to be some UPnP proxy on Router that would receive requests from clients, open ports as usual, and additionally send own UPnP port opening request to upstream router.
OK, so this is the place to start from.That's why I talked about a single PS4 connected directly on Mikrotik's LAN (and with UPnP disabled); if it works to your satisfaction, Mikrotik's handling of 1:1 NAT is not the issue. Have you tried this simplified scenario as a diagnostic step?How can we have all ports open for a given client? That's the issue.
When that is done (UPnP: Off), PS4 shows NAT restricted.
Just a small bit which doesn't help here. But unless you expect the inner NAT to be a 1:1 one again, I think it's not important because in case of stacked NATs, the client would have to be aware of the existence of stacked NAT and use UPnP to request ports at the inner NAT and then, based on the result, request a port on the outer NAT in the name of the inner one. Or, as you've suggested before, the inner NAT would have to act as UPnP client, request a port at the outer NAT, and based on that inform the client about the outer IP and port he's got. So it is probably a scriptable thing if you dive into UPnP enough, but the inner NAT must be able to run scripts, and its UPnP server functionality would have to be fully replaced by the script (in terms that it would receive the requests from the actual client, convert them into outgoing requests to the outer NAT, and create according rules in its own firewall).I've never done anything with multicast before, so I don't even know where to start. Do you know more than I do about this?
Is NAT on second router absolutely necessary? Couldn't there be just a routed subnet? I don't know what exactly it is, if some serious ISP network, it could be a problem, but in some hobby network it could be ok.That router is remotely connected through a wireless CPE so, it is necessary to have a router because that CPE is bridged and the end user needs to connect multiple devices.
Okay, at third reading it clicked after all (well, 2 AM is not so far away). When you replace the word "second" by "the closer one to the client" or "inner", things start making sense. So the client likely ignores service discovery responses indicating a unicast address in non-connected subnet (what else could be the reason), so you satisfy it by giving it a response from a device in a connected subnet, and then steal the requests for that address and deliver them where you really need them to go. Cool. It means that you actually don't need the muticast routing at all provided that the "closer to the client" router supports UPnP and port forwarding in LAN -> WAN direction, and that the "outer" or "closer to internet" router doesn't mind getting client requests from a non-connected subnet.... I saw the response on client with Wireshark, but for some reason client didn't like it, because no further communication followed. When I enable UPnP on second router, the only goal is to make SSDP discovery work. Client accepts response from second router, ...
The latter disqualifies all simple consumer routers I've ever seen.... the "closer to the client" router supports UPnP and port forwarding in LAN -> WAN direction, ...
Modem > MT > SwitchI think it is time you pride the config, in terminal window,
Export file=YourFileName hide-sensitive and either attach the file here or copy and paste the contents between source code brackets
NAT
chain=srcnat action=masquerade out-interface=WAN1 PoE log=no
log-prefix=""
Filter
;;; DMZ Gaming
chain=forward action=accept connection-nat-state=dstnat
in-interface=WAN1 PoE log=no log-prefix=""
If I do that, the rule only works for one of the two consoles when connected directly to MT. If I want both, I need to activate UPnP. But, the problem is when I have the console behind another router.So there is no chain=dstnat action=dst-nat in-interface=WAN1 to-addresses=the.ip.of.the.console rule in /ip firewall nat?
add action=dst-nat chain=dstnat comment=Console dst-port=1-65535 in-interface=WAN1 \
protocol=tcp to-addresses=10.50.10.245 to-ports=3074
add action=dst-nat chain=dstnat dst-port=1-65535 in-interface=WAN1 protocol=udp \
to-addresses=10.50.10.245 to-ports=3074
Not only it is too much for RouterOS, it is too much for logic alone. Imagine two packets, both coming from the same address X.X.X.X in the internet to the single public (wan-side) address W.W.W.W of your router. Given that these two addresses are the only pieces of information you can use to decide whether to forward the packet to LAN-side address L.L.L.1 or to LAN-side address L.L.L.2, which L.L.L.? will you choose for each of the two packets, and why?Game says OpenNAT but everybody else says Moderate or Strict. How can we have OpenNAT for a segment of IPs (multiple video game consoles) with the same WAN and avoiding UPnP?
Is this too much for RouterOS?
Not only it is too much for RouterOS, it is too much for logic alone. Imagine two packets, both coming from the same address X.X.X.X in the internet to the single public (wan-side) address W.W.W.W of your router. Given that these two addresses are the only pieces of information you can use to decide whether to forward the packet to LAN-side address L.L.L.1 or to LAN-side address L.L.L.2, which L.L.L.? will you choose for each of the two packets, and why?
Actually, I have just simplified to the bare bone what I already wrote weeks ago.Thanks for adding more light.
Yes, exactly. Only those WISP's clients who have got a public IP can ever have "OpenNAT".Then, how do Wisps do? Do they assign a public IP to each client so they can have OpenNAT? What if they have like 100 clients?
Yes, I noted that after I wrote this. Because that day it was too much for my layman's knowledge.Actually, I have just simplified to the bare bone what I already wrote weeks ago.
I have 2. How can I have one for normal devices and the other one for 4 consoles? Can I send one Public IP to an entire subnet and the other one to the other?Yes, exactly. Only those WISP's clients who have got a public IP can ever have "OpenNAT".
Will read about itGoogle for STUN if you are interested in more details.
It is normal that a correct information is useless until you get sufficient context.Yes, I noted that after I wrote this. Because that day it was too much for my layman's knowledge.
You cannot, still for the same reason. You can have as many consoles with "open NAT" as you have public IPs, not more.How can I have one for normal devices and the other one for 4 consoles?
Theoretically, you could dst-NAT an incoming unicast packet (i.e. with a destination address matching a single device) to a broadcast address (at which all devices in a whole subnet are supposed to listen). But even if it worked (it actually doesn't because only few processes in the devices' operating systems actually listen at the broadcast address), it would still not be very useful because the packets from the same remote console would be received by all lccal consoles and they would all respond to them, causing a confusion at the remote console.Can I send one Public IP to an entire subnet and the other one to the other?
That sounds like a misconfiguration to me. Normally there is not much to go wrong with UPnP function-wise; it is a security hole (but that's 1:1 dst-NAT too) but it is no rocket science to set up.The upnp method I tried awhile back and it didnt work
That's not needed for the required functionality, but having the console alone in a dedicated VLAN&subnet is a good way to protect the rest of your network from the console if it gets infected.I put the console on its own vlan it didnt work
All that (VRF) is/would be (route rules, mangle rules) an overkill. As @Lebzul has already pointed out, it is enough to use a single dst-nat rule to forward anything that comes from outside to the console's private IP, and a single masquerade (or src-nat) rule for anything leaving through the WAN to be src-nated to that WAN's public IP. This setup is often referred to as a "DMZ" (De-Militarized Zone) one, but to deserve such name, the important part is that there is also a "protected zone", i.e. that the equipment in the DMZ doesn't have an unrestricted access to the rest of your internal network, i.e. that the DMZ and the protected zone are in distinct (V)LANs and subnets, and the firewall rules control which L3 traffic can pass between these two zones, not just the traffic between the internet and the LANs as a whole.I tried all kinds of route contortions including VRFF etc didnt work.
...
If you want to freak me out recommend table main route rules LOL.
There's PCP (Port Control Protocol) for dynamic configuration. Unfortunately, it's the same chicken & egg problem as with basic IPv6, level 2. Clients don't support it, so routers don't implement it. Routers don't support it, so clients don't implement it either. At least you have the last option, simply allow everything and isolate the device. There's so many addresses in IPv6 that each device can easily have a subnet for itself. Well, as long as ISP is not <insert your favourite rude word> who believes that one /64 must be enough for everyone.[IPv6]..., you have to know in advance to what ports to permit incoming connections statically, or have some protocol allowing the LAN device to tell it to the firewall dynamically, or permit full access to a particular LAN side device from outside, but in the latter case it is highly recommendable to isolate that device from the rest of your network so that it cannot spread the bug if infected.
Okay I will go back to the basic UPNP attempt and looks like below.........If you want to use UPnP, the key is to have public address on the same router which works as UPnP server. If it's there, then the interface with it is external for UPnP and the one with (directly) connected console is internal. In case there would be other address(es) on same external interface (probably not in this case), you'd need to specify correct public address as Forced External IP.
# oct/26/2019 16:06:00 by RouterOS 6.45.6
/interface ethernet
set [ find default-name=ether5 ] comment=Port5 name=Bell_eth5 speed=100Mbps
set [ find default-name=ether1 ] comment=Port1 name=Eastlink_eth1 speed=\
100Mbps
set [ find default-name=ether4 ] comment=PI_DNS_RESOLVER name=eth4-PI
set [ find default-name=ether2 ] comment=LAN1-Home speed=100Mbps
set [ find default-name=ether3 ] comment=LAN1-Home speed=100Mbps
/interface bridge
add admin-mac= auto-mac=no comment=defconf name=HomeBridge \
vlan-filtering=yes
/interface vlan
add interface=HomeBridge name=PS4_V55 vlan-id=55
add interface=Bell_eth5 name=vlanbell vlan-id=35
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
add name=VLANSwInt
/ip pool
add name=dhcp-PS4 ranges=192.168.55.5-192.168.55.10
/ip dhcp-server
add address-pool=dhcp-PS4 disabled=no interface=PS4_V55 lease-time=1d name=\
PS4-server
/ip dhcp-server network
add address=192.168.55.0/24 dns-server=8.8.8.8,1.0.0.1 gateway=192.168.55.1
/ip address
add address=192.168.55.1/24 interface=PS4_V55 network=192.168.55.0
/interface bridge port
add bridge=HomeBridge comment=defconf ingress-filtering=yes interface=ether2
add bridge=HomeBridge comment=defconf ingress-filtering=yes interface=ether3
/ip settings
set allow-fast-path=no icmp-rate-limit=100 rp-filter=loose
/interface bridge vlan
add bridge=HomeBridge tagged=HomeBridge,ether2 vlan-ids=\
.....55,.....
/interface list member
add comment=defconf interface=Eastlink_eth1 list=WAN
add interface=vlanbell list=WAN
add interface=PS4_V55 list=VLANSwInt
add interface=PS4_V55 list=LAN
/ip dhcp-client
add add-default-route=no comment=defconf dhcp-options=hostname,clientid \
disabled=no interface=Eastlink_eth1 use-peer-dns=no use-peer-ntp=no
add default-route-distance=255 dhcp-options=hostname,clientid disabled=no \
interface=vlanbell script=":if (\$bound=1) do={ /ip route set [find commen\
t=\"BellFibre\"] gateway=(\$\"gateway-address\") disabled=no; :log warning\
\_(\"New ISP1 gateway: \".(\$\"gateway-address\")) }" use-peer-dns=no \
use-peer-ntp=no
/ip dns
set allow-remote-requests=yes servers=192.168.31.41 comment=pi-resolver
/ip dhcp-server lease
add address=192.168.55.5 client-id= comment=PS4 \
mac-address= server=PS4-server
/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="Allow ADMIN to Router" \
in-interface-list=RBwin log-prefix=AdminAccess src-address-list=\
adminaccess
add action=accept chain=input comment="Allow LAN DNS queries-UDP" \
connection-state=new dst-port=53 in-interface-list=LAN protocol=udp
add action=accept chain=input comment="Allow LAN DNS queries - TCP" \
connection-state=new dst-port=53 in-interface-list=LAN protocol=tcp
add action=drop chain=input comment="DROP ALL ELSE" log-prefix=\
"INPUT DROP ALL"
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, " connection-state=\
established,related
add action=drop chain=forward comment=\
"Drop invalid/malformed packets" connection-state=invalid \
log-prefix=INVALID
add action=accept chain=forward comment="allow VLANS to WAN " \
in-interface-list=VLANSwInt out-interface-list=WAN
add action=accept chain=forward comment=\
"Allow Port Forwarding - DSTNAT" connection-nat-state=dstnat \
connection-state=new in-interface-list=WAN
add action=drop chain=forward comment=\
"DROP ALL other FORWARD traffic" log-prefix="FORWARD DROP ALL"
/ip firewall nat
add action=masquerade chain=srcnat comment="SCR_NAT for LAN - Cable" \
ipsec-policy=out,none out-interface=Eastlink_eth1
add action=masquerade chain=srcnat comment="SCR_NAT FOR LAN - FibreOP" \
out-interface=vlanbell
/ip route
add check-gateway=ping distance=3 gateway=1.0.0.1
add distance=10 gateway=24......
add comment=BellFibre distance=3 dst-address=1.0.0.1/32 gateway=142...... \
scope=10
add comment=Email_bypass distance=1 dst-address=24.222.0.20/32 gateway=\
24.........
/ip upnp interfaces
add interface=vlanbell type=external
add interface=PS4_V55 type=internal
I see. It's a time-consuming task. I think @Sob mentioned it, IPv6 is the way to go in order to avoid the mess. Unfortunately, where I live, I think it's years ahead. Maybe with ISP that offers fiber here but they charge like 300.00USD a month.Theoretically, you could dst-NAT an incoming unicast packet (i.e. with a destination address matching a single device) to a broadcast address (at which all devices in a whole subnet are supposed to listen). But even if it worked (it actually doesn't because only few processes in the devices' operating systems actually listen at the broadcast address), it would still not be very useful because the packets from the same remote console would be received by all lccal consoles and they would all respond to them, causing a confusion at the remote console.
So it could be done like this, but the console developers would have to implement a matching behaviour:And console developers are unlikely to do this before the bulk of firewall/NAT developers implements the possibility to dst-NAT to broadcast addresses.
- each packet would have to carry an unambigous identification of the source in its payload (like the serial number or MAC address of the console), so that packets coming from the same public IP and port could be properly related to a stream at the receiving end.
- the consoles would have to listen on a group address (broadcast or multicast, see below).
And none of this is going to happen - imagine the WISP case where 1000 or so SOHO routers are connected behind the same public IP on the private or "shared" addresses (from the 100.64.0.0/10 subnet), and the WISP has to broadcast the complete incoming traffic to that public IP to all of them because there is no way to tell which traffic is for consoles and which traffic is a "normal" one. So it would require an industry standard to be agreed on, and to use multicast addresses instead of broadcast ones, as you can selectively subscribe to multicast traffic whereas you cannot prevent broadcast traffic from being sent to you.
So the amount of effort spent and cooperation required is too high compared to the potential benefit for the vendors involved.
Just to be clear, a single console behind the MK as the router, with UPNP on, should provide a full on-line gaming capability (not restricted in any way)??
or does one also need to include a specific destination NAT rule for that IP as well?
add action=dst-nat chain=dstnat disabled=no dst-port=3074 in-interface=WAN1 \
protocol=udp to-addresses=10.50.10.122 to-ports=3074 comment="upnp 10.50.10.122: DemonwarePortMapping"
I wonder what in the words chosen by RouterOS authors, or in my own vocabulary, prevents you from understanding the same thing in multiple cases. Maybe the parameter name to-addressses? Yes, to-addresses in the nat rules is a pool, but for each connection, just a single address from that pool is chosen. The packet's header has space for a single destination IP address only, and the packets are not multiplicated by the firewall during the NAT operation.While I was playing with the dsnat I managed to get a TPlink router which is connected to MT LAN (IP 10.50.10.xxx), I was receiving OpenNAT in the game from the private IP (3rd port) of that TPlink router (Like: MT>---10.50.10.xxx--<TPLINK>---<192.168.1.xxx=PS3). I would like to know if by adding that router to a VLAN instead, and providing that VLAN a secondary Public IP, will the console receive again the OpenNAT characteristic by being in that "VLAN_Console subnet"?
If one client in MT with the proper dsnat rule used to get the OpenNAT to its DHCP-ed client (PS3), wouldn't it be the same to create a rule for the entire VLAN Pool? (Not sure if @sindy explained this. Sorry if yes), assuming if it was a normal router.
That's again what I told you - VRRP only provides hardware redundancy for an IP address, aiming at the gateway role of the device currently running that IP address for the subnet for which it serves as a gateway. But VRRP knows nothing about UPnP and UPnP knows nothing about VRRP; you'd need a complete synchronisation of configuration and runtime context between the two routers on top of VRRP, and this is something not provided by RouterOS these days.I believe that aside from UPnP, there should be a scape route. UPnP sometimes causes problems like for example in VRRP. I noted when second MT is Master and some Dynamic rules are requested, they are kept in the second MT, even if the real Master turns on again. I am not completely sure if this breaks the whole purpose of UPnP for video games because I just saw it but didn't test it.
I wonder what in the words chosen by RouterOS authors, or in my own vocabulary, prevents you from understanding the same thing in multiple cases. Maybe the parameter name to-addressses? Yes, to-addresses in the nat rules is a pool, but for each connection, just a single address from that pool is chosen. The packet's header has space for a single destination IP address only, and the packets are not multiplicated by the firewall during the NAT operation.
So you can reserve a DHCP lease of an IP address for the console in the "VLAN_Console subnet" (use of "make static" command on an existing lease is the easiest way to do that), and use that reserved IP address as to-addresses in your dst-nat rule for that console (i.e. for packets arriving to port 3074 of your second public IP). So you'll have one rule per each public IP, each doing a dst-nat to one of the consoles' individual private addresses.
That's again what I told you - VRRP only provides hardware redundancy for an IP address, aiming at the gateway role of the device currently running that IP address for the subnet for which it serves as a gateway. But VRRP knows nothing about UPnP and UPnP knows nothing about VRRP; you'd need a complete synchronisation of configuration and runtime context between the two routers on top of VRRP, and this is something not provided by RouterOS these days.
The VLAN in question is included in forward rule with all other VLANs with access to the internet. Dont understand your ports comment??@anav: UPnP is service (server) running on your router. If it should work, client device must be able to connect to it. With your current firewall it can't (if it's not in adminaccess list, which I assume it isn't). I don't remember what ports are used, but I'm sure you'll find them (they may even be mentioned in this long thread). Or just enable all access with in-interface=PS4_V55 for testing and you can fine tune it later.
UPnP is a way for the LAN host to tell the router itself what nat and forward rules to add to the firewall.The VLAN in question is included in forward rule with all other VLANs with access to the internet. Dont understand your ports comment??
you have lost me big time SINDY.UPnP is a way for the LAN host to tell the router itself what nat and forward rules to add to the firewall.The VLAN in question is included in forward rule with all other VLANs with access to the internet. Dont understand your ports comment??
So the incoming connection from the console to the router itself must be permitted in chain=input of /ip firewall filter.
As for the ports, UPnP is a service like SSH or HTTP, so the router listens for incoming UPnP connections on UDP port 1900. So you have to permit connections to UDP port 1900 which come in through the Tik's interface representing the console's (V)LAN. Do not restrict the rule to any address, just to in-interface and dst-port.
UPnP is a way how a device on the private side of the firewall can tell the firewall device (the Tik in our case) which ports it wants to have forwarded to itself, instead of you setting those port forwards manually. Some devices may ask for tens of ports, so if you can take the associated risks, it is more convenient to manually set a single rule permitting access to the UPnP service than to manually set tens of rules to permit port forwarding from outside.I thought UPNP replaced the need to do port forwarding and if the vlan is already permitted access to the WAN, then it should be good to go.
as said, it is not on top, it is instead of (for the gaming console, that is - you may still have to keep other port forwards configured, for other private side devices which do not support UPnP)Now it seems your saying that on top of the above I need to.
You probably don't want the console (or any other device in your LAN) to have permanent complete access to all management services of your Tik (WinBox, SSH, ...). Hence you restrict it to a single UDP port 1900, which is the port at which Tik expects UPnP requests from private side devices.a. create a firewall rule (input) allowing the IP address of the Console (lan) or the vlan interface to the router itself very bizarre~~
b. something about port 1900, why not just add that to a. and the input rule??
(does playstation use port 1900 or something why 1900, in my case its an X-box console).
UPnP configuration is UPnP configuration and firewall configuration is firewall configuration. I agree that some other applications do dynamically add rules to the firewall, but there it always has some added value in it (dynamic values in the match conditions must be included in those rules). For UPnP in particular, you may e.g. not want to permit access to UPnP to all devices connected via the "internal" interfaces. Hence the firewall is set separately. If you didn't mind devices in that VLAN to have full access to all Tik's services, you wouldn't set the firewall to block such access, would you?Remember I have already told the upnp service what the internal an external interfaces are, why are more rules needed..................
/ip firewall filter
add chain=input in-interface=PS4_V55 connection-state=new protocol=udp dst-port=1900 action=accept comment="for UPnP"
add chain=input in-interface=PS4_V55 connection-state=new protocol=tcp dst-port=2828 action=accept comment="for UPnP"
For UPnP service on UDP 1900c. Filter rule 'INPUT" from vlan interface (or console) to router for what I dont get???????????????
/ip firewall filter
add chain=input action=accept ???????????????????????????????????????????????????
Thanks fella's for your patience, for some reason I keep forgetting that MT does not do anything extra on the programmers behalf, it all has to be manually programmed and assumes the idiot admin (me) actually knows what he is doing. I am curious though about TCP 2828?? (see below, found it).
Thanks to Sob for making me look that up LOL...........
https://wiki.mikrotik.com/wiki/Manual:IP/Services
/ip firewall filter
add chain=input in-interface=PS4_V55 connection-state=new protocol=udp dst-port=1900 action=accept comment="for UPnP"
add chain=input in-interface=PS4_V55 connection-state=new protocol=tcp dst-port=2828 action=accept comment="for UPnP"
It was special made for anav's firewall, to go with the rest of rules where connection-state is included. But otherwise, if you deal with established, related, untracked and invalid, then new is the only one left and you don't have to include it.
Because, as @Sob wrote:Why is it not necessary to add new to the UPnP rule? (Keeping in mind that I have 2 gaming consoles)
[me@MyTik] > ip firewall filter add connection-state=[Tab]if you deal with established, related, untracked and invalid, then new is the only one left and you don't have to include it.
/ip firewall filter
add action=accept chain=input comment=\
"Accept Established, Related, and Untracked Connection Packets" \
connection-state=established,related,untracked
add action=accept chain=input comment="Allow ICMP" protocol=icmp
add action=accept chain=input comment="Allow OVPN VPN" dst-port=0000 protocol=\
tcp
add action=accept chain=input comment="Allow L2TP VPN" dst-port=0000,0000 \
protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=input protocol=ipsec-ah
add action=accept chain=input comment="Allow PPTP VPN" dst-port=0000 protocol=\
udp
add action=accept chain=input protocol=gre
add action=accept chain=input comment="Allow Web Proxy" dst-port=0000 protocol=\
tcp
add action=accept chain=input comment=" Allow UPnP-TCP" dst-port=2828 \
log-prefix=UPnP protocol=tcp src-address-list=UPnP_Devices
add action=accept chain=input comment=" Allow UPnP-UDP" dst-port=1900 \
log-prefix=UPnP protocol=udp src-address-list=UPnP_Devices
add action=drop chain=input comment="Block Invalid Packets" connection-state=\
invalid
add action=drop chain=input comment="Block Web Cache Attacks" dst-por
in-interface=WAN1 protocol=tcp
add action=drop chain=input comment="Block DNS Attacks" dst-port=53 \
in-interface=WAN1 protocol=tcp
Whereas accept and drop are actions of a rule, input is a name of the chain to which the rule belongs (which, for embedded chains, matches the path of the packet through routing and firewall). So first of all, did you actually have accept in mind where you wrote input at the two places above, or is the concept of chains not clear to you?I got the accept ones as first but I have read that drop rules should be after all input ones.
2- Keep Input and drop afterwards and everything else as in the example.
/ip firewall filter
add action=accept chain=input comment=\
"Accept Established and Related Connection Packets" connection-state=\
established,related
add action=drop chain=input comment="Block Invalid and Untracked Packets" \
connection-state=invalid,untracked
add action=accept chain=forward comment=\
"Forward Accept Established and Related Connection Packets" \
connection-state=established,related,untracked
add action=drop chain=forward comment=\
"Forward Block Invalid and Untracked Packets" connection-state=\
invalid,untracked
add action=accept chain=input comment="Allow ICMP" protocol=icmp
add action=accept chain=input comment="Allow OVPN VPN" dst-port=0000 protocol=\
tcp
add action=accept chain=input comment="Allow L2TP VPN" dst-port=0000 \
protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=input protocol=ipsec-ah
add action=accept chain=input comment="Allow PPTP VPN" dst-port=0000 protocol=\
udp
add action=accept chain=input protocol=gre
add action=accept chain=input comment="Allow Winbox from OVPN" dst-port=0000 \
protocol=tcp src-address=10.50.25.50-10.50.25.60
add action=accept chain=input comment="Allow Winbox from L2TP" dst-port=000 \
protocol=tcp src-address=10.50.20.50-10.50.20.60
add action=accept chain=input comment="Allow Winbox from PPTP" dst-port=0000 \
protocol=tcp src-address=10.50.15.50-10.50.15.60
add action=accept chain=input comment="Allow Web Proxy" dst-port=0000 protocol=\
tcp
add action=accept chain=input comment=" Allow UPnP-TCP" dst-port=2828 \
log-prefix=UPnP protocol=tcp src-address-list=UPnP_Devices
add action=accept chain=input comment=" Allow UPnP-UDP" dst-port=1900 \
log-prefix=UPnP protocol=udp src-address-list=UPnP_Devices
add action=drop chain=input comment="Block Web Cache Attacks" dst-port=8080 \
in-interface=WAN1 protocol=tcp
add action=drop chain=input comment="Block DNS Attacks" dst-port=53 \
in-interface=WAN1 protocol=tcp
add action=drop chain=input dst-port=53 in-interface=WAN1 protocol=udp
add action=reject chain=forward comment="Adblock - TCP-Reset" connection-state=\
new dst-address=240.0.0.1 log=yes log-prefix=ADBLOCK protocol=tcp \
reject-with=tcp-reset
add action=reject chain=forward comment="Adblock - UDP-Unreachable" \
connection-state=new dst-address=240.0.0.1 log=yes log-prefix=ADBLOCK \
protocol=udp reject-with=icmp-network-unreachable
/ip firewall filter
add chain=input action=accept comment="accept everything (implicit invisible rule)
add chain=forward action=accept comment="accept everything (implicit invisible rule)