Community discussions

MikroTik App
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Sun Jun 11, 2017 5:29 am

Hello Everyone

How to Preference IPv4 over IPv6 on Dual stack router with Mikrotik RouterOS? because default is by IPv6 connection in dual stack router


The problem if our IPv6 connection over tunnel and have low bandwidth and high lantency..

Thanks
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 1815
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Sun Jun 11, 2017 8:49 am

What do you want to prefere ? Traffic path ? Protocol used ? What protocol your LAN clients use ?
IP6 lives in parallel with IP4 in ROS and they are separated worlds.
Real admins use real keyboards.
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1223
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Sun Jun 11, 2017 5:47 pm

How to Preference IPv4 over IPv6 on Dual stack
...
That you have to set in your client machine. The router will serve both IPv4 and IPv6 if asked for it, with no discrimination. There is no such thing as a protocol "preference" concept in a router.
The client decides what to ask for, not the router.
Torturing CCR1009-7G-1C-1S+, RB450G, RB750GL, RB951G-2HnD, RB960PGS, RB260GSP, OmniTIK 5HnD and NetMetal 922UAGS-5HPacD + R11e-5HnD in my home network.
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Mon Jun 12, 2017 2:31 pm

in client side I think is solved with precedence way.. many tutorial i found in internet but i want to know in router side?

the other solution i think is if I have a DNS server and set in my DNS server for not return AAAA record for the website in question. but that possible in Router Side?
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Mon Jun 12, 2017 2:58 pm

What do you want to prefere ? Traffic path ? Protocol used ? What protocol your LAN clients use ?
IP6 lives in parallel with IP4 in ROS and they are separated worlds.
i mean if my destination website available in IPv4 and IPv6 such as google, youtube, facebook.. if I in dual stack router.. and open one of them, my router will be directly choose their IPv6.. the problem is my IPv6 connection in my dual stack by tunnel.. so it will be slowly and high latency..
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 1815
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Mon Jun 12, 2017 6:13 pm

Seems to be deeper problem than you ask. It is not router opening sites. Clients do so router just forwards packets from client to the Internet and back.
You want router to decide on the fly which route to the destination is better over IP4 or IP6 and then do proper masquarading or translation from IP4 to IP6 or IP6 to IP4 to achieve the fastest answer.
How do you want to rate which route is the best to download page ? What if some elements are downloaded from main site but some from other ones ? Should router split the traffic to more than one path/route/ISP to make it load faster ? That is not router job. Router is for routing. You are asking for smart load balancer or proxy splitting traffic not only to different ISP but to IP4, IP6.

I doubt if Mikrotik is the proper solution.
Real admins use real keyboards.
 
proximus
Member Candidate
Member Candidate
Posts: 113
Joined: Tue Oct 04, 2011 1:46 pm

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Mon Jun 12, 2017 6:52 pm

If IPv6 is so problematic in your environment, why even have it enabled? Do you have IPv6-only sites you have to connect to?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Mon Jun 12, 2017 9:07 pm

You seem to misunderstand the nature of IPv4 vs. IPv6.

They're complete parallel universes. The router doesn't evaluate routing based on "site" being visited and then decide which protocol to use to get there. The decision was already made by one of the two endpoints communicating with each other. Thus If the router receives an IPv6 packet, then it forwards that packet according to the IPv6 routing table and IPv6 firewall rules. If it receives an IPv4 packet, then it forwards the packet based on the IPv4 routing table and firewall rules. ROS has no capability to directly interwork the two protocols (with such things as NAT64, etc), anyway, so there's no way it can influence which protocol the client PCs choose to make their connections.
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 9:58 am

You seem to misunderstand the nature of IPv4 vs. IPv6.

They're complete parallel universes. The router doesn't evaluate routing based on "site" being visited and then decide which protocol to use to get there. The decision was already made by one of the two endpoints communicating with each other. Thus If the router receives an IPv6 packet, then it forwards that packet according to the IPv6 routing table and IPv6 firewall rules. If it receives an IPv4 packet, then it forwards the packet based on the IPv4 routing table and firewall rules. ROS has no capability to directly interwork the two protocols (with such things as NAT64, etc), anyway, so there's no way it can influence which protocol the client PCs choose to make their connections.
Okay sir.. I see.. thanks for your explanation.. so the solution is on client side or on server side..
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 9:59 am

If IPv6 is so problematic in your environment, why even have it enabled? Do you have IPv6-only sites you have to connect to?
it's just my research sir.. i wanna deep learning about IPv6 in Mikrotik RouterOS ..
 
teddyyuliswar
just joined
Topic Author
Posts: 20
Joined: Wed Apr 27, 2016 3:35 am
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 10:02 am

Seems to be deeper problem than you ask. It is not router opening sites. Clients do so router just forwards packets from client to the Internet and back.
You want router to decide on the fly which route to the destination is better over IP4 or IP6 and then do proper masquarading or translation from IP4 to IP6 or IP6 to IP4 to achieve the fastest answer.
How do you want to rate which route is the best to download page ? What if some elements are downloaded from main site but some from other ones ? Should router split the traffic to more than one path/route/ISP to make it load faster ? That is not router job. Router is for routing. You are asking for smart load balancer or proxy splitting traffic not only to different ISP but to IP4, IP6.

I doubt if Mikrotik is the proper solution.

thanks sir for your explanation too.. I just want to make sure sir ..
 
Sitron
newbie
Posts: 37
Joined: Wed Jul 29, 2009 11:49 pm
Location: Arendal, Norway

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 3:09 pm

If IPv6 is so problematic in your environment, why even have it enabled? Do you have IPv6-only sites you have to connect to?
it's just my research sir.. i wanna deep learning about IPv6 in Mikrotik RouterOS ..
Well, that is a problem with IPv6 not being available native from your ISP: You can run it thru a tunnel, for research/fun, but the problem is latency and speed. However, if an OS supports IPv6, it will use it by default, even if it's not as fast as IPv4. Neither the client nor router does any checking for latency or bandwidth, just connectivity.

There is, unfortunately, the way it has to be :-/
 
savage
Forum Guru
Forum Guru
Posts: 1220
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 3:45 pm

Seems to be deeper problem than you ask. It is not router opening sites.
I don't quite agree with that statement. Thanks to MT adding piles of things onto MT, which a ROUTER is not supposed to do, it IS the MT opening sites...

For example
- web proxy.... MT would need to give preference to connect to a site via IPv6, instead of IPv4.
- /tool/ping www.acme.com MT would need to give preference to ping the site with IPv6, and not IPv4

The same with traceroute, DNS, afaik, the same with ANY "service" that MT runs, which is IPv6 capable.

sigh. Reasons to keep a router a ROUTER, and not a 'jack of all trades', ai...
Regards,
Chris
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 1815
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 3:59 pm

No.
Router is passing packets back and forth.
However Mikrotik offers additional funcionality of proxy which handles cache of pages so it means that it opens/loads page instead of client but it is client starting conversation so the client decides if the "talk" is handled in IP4 world or in IP6 ... it depends on DNS name resolution and I do not know if IP4's DNS client resolves names to IP6 one's. Really do not know if it is valid at all.
Mikrotik's webproxy IMHO is not so sophisticated to prefetch pages using IP6 instead of IP4 ... why do you assume that DNS resolves names in IP6 and IP4 to same service ? Are you sure to you can assume (read: proxy could assume) that "http4://...." is the same content as "http6://...." ?

Why MT should prefere IP6 over IP4 ? Why ping should prefere IP6 over IP4 ?
Windows Servers prefere IP6 over IP4 and it makes a lot of trouble as ping to localhost usually talk in IP6 and then all services should be aware of that. Try to connect to SQL Server with localhost if it is configured in IP4 domain only etc....

Therefore I have written that it is deeper problem.
Real admins use real keyboards.
 
savage
Forum Guru
Forum Guru
Posts: 1220
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 4:06 pm

However Mikrotik offers additional funcionality of proxy which handles cache of pages so it means that it opens/loads page instead of client but it is client starting conversation so the client decides if the "talk" is handled in IP4 world or in IP6 ...
Not true. Go learn how proxy servers work. The client has ZERO to do with this, if a proxy is involved.

The client purely sends to the proxy (in it's simplest form - it does not even attempt to resolve http://www.myhost.com):
GET / HTTP/1.0
Hostname: http://www.myhost.com

The PROXY does a DNS lookup on http://www.myhost.com and the DNS then returns both a IPv4, as well as IPv6 address. The PROXY decides, whether or not to connect via IPv4, or IPv6 - NOT the client. :)

There are many reasons too, why I would want to ping/traceroute http://www.myhost.com using an IPv6 address, instead of an IPv4 address - for example. As I said, it's ANY service in MT which supports IPv6, where this issue would come up.

Some providers (us included) are actually also starting to charge different rates for IPv4 vs. IPv6 traffic, to encourage IPv6 uptake. There's many, many reasons why IPv6 is preferred over IPv4, and it's unfortunately the defacto standard moving forward. IPv4 is going to be dieing a slow and painful death.
Regards,
Chris
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 1815
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 6:36 pm

OK....let's agree at this point .... but :-) ..... AFAIK there are many types of proxy and I do not know if IP4 -> IP6 masqarading is what I expect to be done behind the scenes. If I'm in IP4 domain I expect to be IP4 all the time. Maybe lucky those who do not know :-)
Real admins use real keyboards.
 
Sob
Forum Guru
Forum Guru
Posts: 5590
Joined: Mon Apr 20, 2009 9:11 pm

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Tue Jun 13, 2017 7:52 pm

If you're telling web proxy to connect to http://www.something.com, then it's exactly what you get. You shouldn't care if it uses IPv4 or IPv6. I don't know about any standard mechanism to influence that (but I didn't really search for one).

If you had SOCKS proxy instead (not MikroTik one, because it doesn't support IPv6), you'd have a choice. You could resolve DNS locally and then tell proxy to connect to IPv4 or IPv6 address. Or you could just give it hostname and let it decide (like web proxy does).
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.
 
idlemind
Forum Guru
Forum Guru
Posts: 1147
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Thu Jun 15, 2017 4:44 pm

Two words, happy eyeballs!

The big browser vendors should be performing checks for availability and taking whichever is faster. If you're tunneled you'll want to make sure MTU is being handled cleanly. Do you have firewall rules in place on both the router and your local machine to ensure necessary ICMPv6 messages are making it through? Alternatively set the MTU of one of your PCs to 1280 and see if performance improves.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 1815
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Fri Jun 16, 2017 7:46 am

...You shouldn't care if it uses IPv4 or IPv6. I don't know about any standard mechanism to influence that (but I didn't really search for one).....
So it means that suggest that proxy could switch from IP4/IP6 on the fly as one them becomes faster ? What eg. about sessions consistency ?
Asking as I do not recall using myself any proxy intentionally.
Real admins use real keyboards.
 
idlemind
Forum Guru
Forum Guru
Posts: 1147
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Fri Jun 16, 2017 8:16 am

...You shouldn't care if it uses IPv4 or IPv6. I don't know about any standard mechanism to influence that (but I didn't really search for one).....
So it means that suggest that proxy could switch from IP4/IP6 on the fly as one them becomes faster ? What eg. about sessions consistency ?
Asking as I do not recall using myself any proxy intentionally.
https://tools.ietf.org/html/rfc6555

As far as the behavior of a specific proxy implementation I can't say. That said HTTP to an IPv4 or IPv6 only host can be proxied by a dual stack proxy server.
 
Sob
Forum Guru
Forum Guru
Posts: 5590
Joined: Mon Apr 20, 2009 9:11 pm

Re: How to Preference IPv4 over IPv6 on dual stack router on Mikrotik RouterOS?

Fri Jun 16, 2017 4:11 pm

Basic proxy is just another program, so it's most likely to behave the same way as web browser on dual stack host. If it has native IPv6 connectivity, it will prefer IPv6, and that's it. It has no reason to madly jump between IPv4/IPv6 for same target hostname.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.

Who is online

Users browsing this forum: cbpapi, eworm and 79 guests