OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • Map IPv6 to IPv4
« previous next »
  • Print
Pages: [1]

Author Topic: Map IPv6 to IPv4  (Read 3272 times)

mahescho

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 2
    • View Profile
Map IPv6 to IPv4
« on: December 12, 2018, 10:04:17 pm »
Hi,

for some good reason  :) I need to map a IPv6 address to an internal RFC1918 IPv4 address.

IPv6-Client -> IPv6-Port-At-Firewall -> IPv4-Port-Internal-RFC1918-Address

E.g. a TCP relay which listens on a IPv6 address / port on the firewall and forwards all Traffic to a internal RFC 1918 IPv4 address / port. Some thing like this:

Code: [Select]
socat TCP6-LISTEN:1234,fork TCP4:1.2.3.4:1234
or

Code: [Select]
6tunnel -6 1234 1.2.3.4 1234
or using xinetd

Code: [Select]
service rdp_port_forward
{
    flags           = IPv6
    disable         = no
    type            = UNLISTED
    socket_type     = stream
    protocol        = tcp
    user            = nobody
    wait            = no
    redirect        = 1.2.3.4 1234
    port            = 1234
}

What is the best way to do this or some thing similar with Opnsense? Can this be done by a simple pf rule or perhaps by haproxy?

TIA
Logged
OPNsense 21.1.2-amd64
FreeBSD 12.1-RELEASE-p13-HBSD
OpenSSL 1.1.1j 16 Feb 2021

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Map IPv6 to IPv4
« Reply #1 on: December 12, 2018, 10:11:53 pm »
I have implemented Streams in the nginx plugin which has been released today but haproxy should be able to do this as well. Both are similar in configuration so use whatever you have already on your machine. Please note that you will loose the real source IP unless the upstream service is capable of the PROXY protocol which is supported by both.
Logged

mahescho

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 2
    • View Profile
Re: Map IPv6 to IPv4
« Reply #2 on: December 12, 2018, 10:24:57 pm »
Thanks. Well I think I will use nginx as I use it to implement client certificates already. I would prefer haproxy but it does not support client certificates by gui in Opnsense AFAIK. The target client software does not support IPv6 at all so loosing the source IP is the trade off here anyway.
Logged
OPNsense 21.1.2-amd64
FreeBSD 12.1-RELEASE-p13-HBSD
OpenSSL 1.1.1j 16 Feb 2021

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Map IPv6 to IPv4
« Reply #3 on: December 12, 2018, 10:32:15 pm »
HAProxy should support client certificates as well (https://github.com/opnsense/plugins/issues/426).
Logged

mahescho

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 2
    • View Profile
Re: Map IPv6 to IPv4
« Reply #4 on: December 12, 2018, 10:38:02 pm »
Missed this one ... thanks for the hint !
Logged
OPNsense 21.1.2-amd64
FreeBSD 12.1-RELEASE-p13-HBSD
OpenSSL 1.1.1j 16 Feb 2021

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • Map IPv6 to IPv4
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2