Community discussions

MikroTik App
avg
刚刚加入了
Topic Author
Posts: 3
加入: Wed Oct 02, 2019 7:58 am

2 Wan

Fri Mar 20, 2020 3:17 pm

Hello guys.
I'm new in Mikrotik.
I would ask to help.
I have a 2 wan connections on the router and 1 lan network.

ethernet1 first ISP = 10.3.1.120
ethernet2 second ISP = 192.168.8.50
ethernet3-5 Lan = 10.2.1.0/24

So, in Lan network on the computer i have an app which connects to the IceCast server 193.70.21.247
I want to do the second, from computer 10.2.1.45 by port 80 to connect to IceCast server 193.152.60.43 to port 80 from 1 wan
and the second connection from computer 10.2.1.45 by port 81 to IceCast server 193.152.60.43 to port 80 from 2 wan

Thanks in advance.
Sorry for my bad English.
Last edited byavgon Sun Mar 22, 2020 11:52 am, edited 1 time in total.
Top
用户avatar
anav
Forum Guru
Forum Guru
Posts: 16516
加入: 太阳2月18日,2018年十一28点
Location:Nova Scotia, Canada
Contact:

Re: 2 Wan

Fri Mar 20, 2020 6:09 pm

Hello guys.
I'm new in Mikrotik.
I would ask to help.
I have a 2 wan connections on the router and 1 lan network.

ethernet1 first ISP = 10.3.1.120
ethernet2 second ISP = 192.168.8.50
ethernet3-5 Lan = 10.2.1.0/24

So, in Lan network on the computer i have an app which connects to the IceCast server 193.152.60.43
I want to do the second, from computer 10.2.1.45 by port 80 to connect to IceCast server 193.152.60.43 to port 80 from 1 wan
and the second connection from computer 10.2.1.45 by port 81 to IceCast server 193.152.60.43 to port 80 from 2 wan

Thanks in advance.
Sorry for my bad English.
I am not sure I understand.
There is nothing stopping your individual PCs to connect to outside servers.

I believe what you are trying to state is that you want PC A, to use WAN1 for all traffic or just traffic to that IP address
and PC B to use WAN2 for all traffic or for a specific IP address.

So use of mangle rules will probably be required to capture traffic coming out of those devices/PCs, to help direct them out the right WAN.
Could probably be coupled with route rules to make this happen.
Top
avg
刚刚加入了
Topic Author
Posts: 3
加入: Wed Oct 02, 2019 7:58 am

Re: 2 Wan

Sun Mar 22, 2020 11:50 am

Thanks for your answer.

IceCast server works on 80 port.
I want to do 2 connections from one pc (10.2.1.45) to icecast server, each connection should go throw different ISP.
So, first connection from 10.2.1.45:80 to 193.70.21.247:80 throw ISP1 - with this connection is everything OK
Second connection from 10.2.1.45:81 to 193.70.21.247:81 - since the icecast server is running on port 80 in mikrotik i have DSNAT rule from 81 port to adress and port to 193.70.21.247:80

In Mikrotik Firewall --> NAT i have rule's

1链= dstnat action = dst-nat地址= 193.70。21.247 to-ports=80 protocol=tcp in-interface=Lan dst-port=81 log=no log-prefix=""

2 chain=srcnat action=masquerade out-interface=ether1 log=no log-prefix=""

3 chain=srcnat action=masquerade out-interface=ether2 log=no log-prefix=""


In Mikrotik Firewall --> Mangle i have rule's

0 D ;;; special dummy rule to show fasttrack counters
chain=prerouting action=passthrough

1 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough

2 D ;;; special dummy rule to show fasttrack counters
chain=postrouting action=passthrough

3 chain=prerouting action=mark-connection new-connection-mark=ISP2-conn
passthrough=yes protocol=tcp src-address=10.2.1.45 in-interface=Lan
dst-port=81 log=no log-prefix=""

4 chain=prerouting action=mark-routing new-routing-mark=Wan2 passthrough=no
protocol=tcp src-address=10.2.1.45 connection-mark=ISP2-conn
in-interface=Lan dst-port=81 log=no log-prefix=""

5 X chain=prerouting action=mark-connection new-connection-mark=ISP2-conn
passthrough=yes in-interface=ether1 log=no log-prefix=""

6 X chain=output action=mark-routing new-routing-mark=Wan2 passthrough=yes
src-address=10.2.1.45 connection-mark=ISP2-conn out-interface=ether1

In Mikrotik Route rule's

# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 10.3.1.1 2
1 ADS 0.0.0.0/0 192.168.8.1 1
2 ADC 10.2.1.0/24 10.2.1.1 Lan 0
3 ADC 10.3.1.0/24 10.3.1.252 ether1 0
4 ADC 192.168.8.0/24 192.168.8.101 ether2 0

Gateway 10.3.1.1 has routing Mark: Wan2


I have already reached the point where the connection is through the second provider is connecting to icecast server, but icecast server after some time drops this connection with error:
WARN source/get_next_buffer Disconnecting source due to socket timeout
IceCast drop's connection only for the second connection throw the Second ISP, from the first ISP connection is working flawlessly.
Top
用户avatar
anav
Forum Guru
Forum Guru
Posts: 16516
加入: 太阳2月18日,2018年十一28点
Location:Nova Scotia, Canada
Contact:

Re: 2 Wan

Sun Mar 22, 2020 2:07 pm

Well I think you are on the right track,
Specific IP, with specific outbound port destination - mangle it
Specific IP, with specific outbound port destination - mangle it.

specific ip route rule for first mangle
specific ip route rule for second mangle
normal ip route rule for rest of traffic.

What bothers me is why are you creating a dstnat rule for any of this?
The server your pC is connecting to is on the external internet.


Any other advice will have to come from someone with an MCTNA and not an MTUNA.
Top

Who is online

用户s browsing this forum:Ahrefs [Bot],MrWillGFC,Slip6953and 19 guests