PageViews: 640 hits / 102 nets

IPv6 Support in DeleGate

IPv6-DeleGate Implementation Note

    Current version: DeleGate/9.0.0
                                                              Yutaka Sato
                                                              April 22, 2005

DeleGate version 9 started supporting IPv6 as the first step of it. 
But since I don't have a practical IPv6 environment, nor necessity of it
(I'm developing it on MacOS X without IPv6 connection to Internet),
I'm not sure if or not it is applicable for practical use.  So comments
from practical users will be appreciated.  Your comments are welcome to
be posted to the open feedback board at (via

This note is written for users familiar with DeleGate.  If you are not,
see the reference manual <URL:>
I expect that just reading 1.1 and 1.2 below is enough for most users of
DeleGate who use it as a proxy server for usual application protocol on
TCP/IP(v4/v6) like HTTP or so.

1. Common Issue
1.1 IPv6 address notation in DeleGate
  Use "_" for ":".  "%" for scope Id can be used 'as is' in most situation.
     "__" for "::"
     "fe80__12_34_56" for "fe80::12:34:56"
     "fe80__12_34_56%en0" for "fe80::12:34:56%en0" (with scope id name)
     "fe80__12_34_56%5" for "fe80::12:34:56%5" (with numeric scope id)

1.2 Accepting at IPv6/IPv4 port
  Specify IPv6 host name or address in -Phost:port option.
     -P9999            ... accept IPv4 only (for -P0.0.0.0:9999)
     -P__:9999         ... accept IPv6 only
     -P__0:9999        ... accept IPv4 and IPv6 together
     -P9999,__:9999    ... accept IPv4 and IPv6 respectively
     -Pfe80__12_34%en0:9999 ... accept IPv6 link local address
     -Pme:9999 HOSTS=me/fe80__12_34%en0 ... by host name

  "__0" means using IPv4-mapped IPv6 address if it's available on the host.

1.3 Host name resolution to IPv6/IPv4 address
  By default, IPv4 address is retrieved first. If it's not available,
  IPv6 next.  This order can be controlled with the RES_AF parameter.
     RES_AF=46         ... retrieve IPv4 address first (default)
     RES_AF=64         ... retrieve IPv6 address first
     RES_AF=4          ... retrieve IPv4 address only
     RES_AF=6          ... retrieve IPv6 address only

  Or it can be controlled by adding special prefixes for each hostname.
     hostname          ... follows RES_TYPES setting
     _46.hostname      ... retrieve IPv4 address first
     _64.hostname      ... retrieve IPv6 address first
     _4.hostname       ... retrieve IPv4 address only
     _6.hostname       ... retrieve IPv6 address only

1.4 Default access control
  64bits mask is used for "on the same networks with me".
  That is, ".localnet" includes "./ffff_ffff_ffff_ffff__"

1.5 Connecting to IPv6 port
  Done automatically in most situation.  When "%scopeid" cannot be used
  as in URL, it is necessary to be escaped using HOSTS parameter.

1.6 Routing by address family of destination host
  "_6." and "_4." prefix to each host in HostList is introduced.
     PROXY="v6gw:8080:_6.*" ... forward to the proxy if the server is IPv6
     SOCKS="v6gw:1080:_6.*" ... forward to the SOCKS if the server is IPv6

2. Application Protocol Specific Issue
2.1 DNS (RFC1886)
  The following RR are relayed by DNS-DeleGate as a proxy resolver
  (with SERVER=dns)

2.2 FTP (RFC2428)
  The following commands are supported to represent IPv6 address.

2.3 SOCKS (RFC1928)
  The following methods (for TCP) accept addresses represented in IPv6.

2.4 HTTP
     http://xxxx--yy-zz.ipv6  for xxxx::yy:zz

    "subin/dgbind", as an executable file with the setuid bit set and
    owned by super-user, is used to bind a socket to a privileged port,
    without running the DeleGate itself under super-user.
    but when this is used with IPv6 address, like -P__:80,
    it fails because of EACCESS, at least on MacOSX.
    [must be supported]
    defining a host with mixture of IPv4 and IPv6 addresses.
    [will not be supported]
  UDP/IPv6 over SOCKS
    [should be supported, if someone need it]
  DNS over UDP over IPv6
    [should be supported, if someone need it]
    [will not be supported]
Yutaka Sato @ DeleGate.ORG