LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-07-2012, 08:50 PM   #1
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 133

Rep: Reputation: 18
How do I map an IPv4 connection to IPv6?


Hi,

I want MySQL (port 3306) to also listen on port 3306 on IPv6 - it currently only listens on IPv4 0.0.0.0:3306.

Can someone tell me the iptables rule for this?

Here is the equivilant for Windows:
Code:
netsh interface portproxy add v6tov4 listenport=3306 connectaddress=127.0.0.1 connectport=3306
 
Old 02-10-2012, 11:27 AM   #2
larrym82
Member
 
Registered: Dec 2011
Posts: 71

Rep: Reputation: Disabled
Quote:
Originally Posted by FireRaven View Post
Hi,

I want MySQL (port 3306) to also listen on port 3306 on IPv6 - it currently only listens on IPv4 0.0.0.0:3306.

Can someone tell me the iptables rule for this?

Here is the equivilant for Windows:
Code:
netsh interface portproxy add v6tov4 listenport=3306 connectaddress=127.0.0.1 connectport=3306
Hi,

I'd start here: http://en.wikipedia.org/wiki/IPv6_address

this might work even better: http://docs.oracle.com/javase/1.4.2/...et/ipv6_guide/

Best

Last edited by larrym82; 02-10-2012 at 11:30 AM. Reason: additional info
 
Old 03-30-2012, 06:22 PM   #3
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 133

Original Poster
Rep: Reputation: 18
None of that helps.

I'm unsure if I need to set up an internal iptables NAT to do this or can just do simple port forwarding...
 
Old 03-31-2012, 05:05 AM   #4
WizadNoNext
Member
 
Registered: Nov 2009
Posts: 122

Rep: Reputation: 9
Quote:
Originally Posted by FireRaven View Post
None of that helps.

I'm unsure if I need to set up an internal iptables NAT to do this or can just do simple port forwarding...
Answer is no. You cannot do NAT between OSI Layer 3 protocols. You have to setup tunnel to do so.
Look in your config files to find out where are IPs on which it is supposed to listen.
If you have auto-configured IP based on EUI (e.g. MAC), then you are lucky, cause you would always have exactly same IPv6 address, if no try to find interfaces on which it is supposed to listen.
If all of this would fail you have no other choice, but to use sit interface, which would "translate" your IPv6 to IPv4. Do not ask me how to do it this way, as all what I am using sit for is IPv6-in-IPv4 Tunnel provided by hurricane
 
Old 03-31-2012, 07:42 AM   #5
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 133

Original Poster
Rep: Reputation: 18
I am simply trying to forward TCP port 3306 to another address. It can be done in windows simply with that one command.
I am not sure the exact terminology for but it can be done with a NAT table, just wondering if there is a simpler way without the overhead with NAT.
 
Old 03-31-2012, 07:54 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,599
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Quote:
Originally Posted by FireRaven View Post
I want MySQL (port 3306) to also listen on port 3306 on IPv6 - it currently only listens on IPv4
As per the last comment in bug id 8836:
Quote:
[29 Feb 11:30] Trent Lloyd
MySQL 5.5 and later supports IPv6 fully for client connections, but is currently undocumented.
To configure MySQL 5.5 and later to accept IPv6 connections, use the following configuration option.
bind-address = ::
MySQL 5.1 and earlier cannot accept IPv6 connections in any configuration.
Using iptables rules is not the way. Check your version first.
 
Old 03-31-2012, 10:39 AM   #7
WizadNoNext
Member
 
Registered: Nov 2009
Posts: 122

Rep: Reputation: 9
Quote:
Originally Posted by FireRaven
I am not sure the exact terminology for but it can be done with a NAT table, just wondering if there is a simpler way without the overhead with NAT.
It cannot be done with NAT! I've already stated it! You cannot NAT between OSI Layer 3 protocols! t is NAT (Network Address Translation - this doesn't mean inter-protocol NAT. IPv4 and IPv6 are completely separate protocols! IPv6 isn't on top of IPv4 - it is separate protocol! It is simply imposible to NAT IPv6 into IPv4 or IPv4 into IPv4 protocol. You can setup tunnel, which will do what you want, but it won't be NAT!
 
Old 04-02-2012, 09:54 AM   #8
squat001
LQ Newbie
 
Registered: Jul 2004
Location: UK
Distribution: lots
Posts: 9

Rep: Reputation: 0
Smile IPv6 to IPv4

Think want you are trying to do is simple redirect traffic from a local IPv6 address to the IPv4 local loopback address?

What your Windows netsh command is doing is reverse proxying the connection from the IPv6 address to the IPv4 or using an IPv6-to-IPv4 Transport Relay Translator (TRT)

First see if your version of MySQL supports IPv6 so to avoid NAT and Proxy config, failing that you could look at NAT64 which is allows a some basic translation between IPv6 and IPv4 but is more global as NATs whole subnets and has no layer 4 controls.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv4 to IPv6 Winanjaya Linux - Networking 1 06-14-2010 07:45 AM
IPv6 vs IPv4 jiml8 Programming 2 12-22-2008 10:53 AM
ipv6 and ipv4 Ammad Linux - Networking 1 12-02-2006 03:44 PM
ipv4 to ipv6 anant_wsu Linux - Networking 1 01-03-2006 04:28 PM
ipv4 vs. ipv6 radix Linux - Security 2 09-17-2003 01:39 PM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration