4
Address Translation
77
Specifying the NAT IP Address
In
the
preceding
example,
the
IP
address
used
for
NAT
is
the
IPv4
address
of
the
destination
interface.
The
alternative
is
to
specify
another
IPv4
address
that
is
to
be
used
on
the
destination
interface.
This
is
done
by
specifying
the
SetSourceAddress
option
as
AllToOne
and
using
the
NewSourceIP4
option
to
specify
the
new
NAT
address
for
the
interface.
Example: Specifying the NAT IPv4 address
This
example
is
the
same
as
the
preceding
example
except
the
NAT
address
used
on
the
wan
interface
is
to
be
explicitly
specified
as
10.0.0.1
1. Change
the
current
category
to
be
the
main
IP
rule
set:
Device:/>
cc
IPRuleSet
main
2. Create
the
IP
rule:
Device:/IPRuleSet/main>
add
IPRule
Action=Allow
SourceInterface=sfp1
SourceNetwork=sfp1net
DestinationInterface=wan
DestinationNetwork=all
‐
nets
Service=http
SourceTranslation=NAT
SetSourceAddress=AllToOne
NewSourceIP4=10.0.0.1
Name=NAT_HTTP
3. Return
to
the
default
CLI
context
if
no
more
rules
are
needed:
Device:/IPRuleSet/main>
cc
Device:/>
The
IPv4
address
10.0.0.1
must
also
be
explicitly
ARP
published
on
the
wan
interface
if
it
is
not
already
one
of
the
addresses
assigned
to
that
interface.
IPv4 and IPv6 NAT addresses
In
the
example
above,
the
option
NewSourceIP6
could
be
used
to
specify
an
IPv6
address
as
the
NAT
address.
Either
or
both
of
NewSourceIP4
and
NewSourceIP6
must
be
specified
in
the
same
rule
when
the
SetSourceAddress=AllToOne
option
is
used.
If
the
NAT
rule
allows
both
IPv4
and
IPv6
addresses
(for
example,
the
source
IP
might
be
all
‐
nets
),
both
NewSourceIP4
and
NewSourceIP6
will
have
to
be
specified
since
the
rule
must
deal
with
applies
NAT
to
both
addresses
types.
ARP publishing the NAT IPv4 address
As
mentioned
in
the
last
NAT
example,
if
the
NAT
IP
address
is
not
already
ARP
published
on
the
Ethernet
interface,
this
must
be
done
explicitly.
Doing
this
is
described
in
ARP
on
page
58
.
ARP
publishing
of
all
the
IP
addresses
already
assigned
to
an
Ethernet
interface
is
done
automatically
and
any
Ethernet
interface
can
have
multiple
IP
addresses
associated
with
it.