summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/nat_cmd.c8
-rw-r--r--usr.sbin/ppp/ppp.811
-rw-r--r--usr.sbin/ppp/ppp.8.m411
3 files changed, 19 insertions, 11 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c
index baa53503604d..2c4274f39957 100644
--- a/usr.sbin/ppp/nat_cmd.c
+++ b/usr.sbin/ppp/nat_cmd.c
@@ -345,7 +345,7 @@ nat_SetTarget(struct cmdargs const *arg)
struct in_addr addr;
if (arg->argc == arg->argn) {
- addr.s_addr = INADDR_NONE;
+ addr.s_addr = INADDR_ANY;
PacketAliasSetTarget(addr);
return 0;
}
@@ -353,6 +353,12 @@ nat_SetTarget(struct cmdargs const *arg)
if (arg->argc != arg->argn + 1)
return -1;
+ if (!strncasecmp(arg->argv[arg->argn], "MYADDR")) {
+ addr.s_addr = INADDR_ANY;
+ PacketAliasSetTarget(addr);
+ return 0;
+ }
+
addr = GetIpAddr(arg->argv[arg->argn]);
if (addr.s_addr == INADDR_NONE) {
log_Printf(LogWARN, "%s: invalid address\n", arg->argv[arg->argn]);
diff --git a/usr.sbin/ppp/ppp.8 b/usr.sbin/ppp/ppp.8
index a9c16373717f..32bb448ba55c 100644
--- a/usr.sbin/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp.8
@@ -2995,13 +2995,14 @@ connections to come from a well known port.
.It nat target Op Ar address
Set the given target address or clear it if no address is given. The target
address is used by libalias to specify how to NAT incoming packets by default.
-If a target address is not set, the alias address (that of the tun interface)
-is used.
+If a target address is not set or if
+.Dq default
+is given, packets are not altered and are allowed to route to the internal
+network.
.Pp
The target address may be set to
-.Dq default ,
-in which case libalias will not alter the destination address of new
-incoming data.
+.Dq MYADDR ,
+in which case libalias will redirect all packets to the interface address.
.It nat use_sockets yes|no
When enabled, this option tells the network address translation engine to
create a socket so that it can guarantee a correct incoming ftp data or
diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4
index a9c16373717f..32bb448ba55c 100644
--- a/usr.sbin/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp.8.m4
@@ -2995,13 +2995,14 @@ connections to come from a well known port.
.It nat target Op Ar address
Set the given target address or clear it if no address is given. The target
address is used by libalias to specify how to NAT incoming packets by default.
-If a target address is not set, the alias address (that of the tun interface)
-is used.
+If a target address is not set or if
+.Dq default
+is given, packets are not altered and are allowed to route to the internal
+network.
.Pp
The target address may be set to
-.Dq default ,
-in which case libalias will not alter the destination address of new
-incoming data.
+.Dq MYADDR ,
+in which case libalias will redirect all packets to the interface address.
.It nat use_sockets yes|no
When enabled, this option tells the network address translation engine to
create a socket so that it can guarantee a correct incoming ftp data or