diff options
author | brian <brian@FreeBSD.org> | 2000-05-11 07:55:44 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-05-11 07:55:44 +0000 |
commit | ba5219342d36bcb4d9e8a021fd2ae731c837b4ef (patch) | |
tree | 9ab888ba468a40f7a9e1da81e6251bfc48630de6 /usr.sbin | |
parent | b8a9bbd08b7a1b30b25b648eabba248d4cf1dd3d (diff) | |
download | FreeBSD-src-ba5219342d36bcb4d9e8a021fd2ae731c837b4ef.zip FreeBSD-src-ba5219342d36bcb4d9e8a021fd2ae731c837b4ef.tar.gz |
Mention that the default is to let external traffic route to
the internal network when NAT is enabled.
Allow ``set target MYADDR'' to stop packets at the gateway.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/nat_cmd.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp.8 | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp.8.m4 | 11 |
3 files changed, 19 insertions, 11 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c index baa5350..2c4274f 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 a9c1637..32bb448 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 a9c1637..32bb448 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 |