Skip to content

Commit

Permalink
apply MASQ only to private network
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 4, 2010
1 parent d4ef35d commit abb7ea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/vnetwork.c
Expand Up @@ -185,7 +185,7 @@ void vnetInit(vnetConfig *vnetconfig, char *mode, char *eucahome, char *path, in
snprintf(cmd, 256, "-A FORWARD -d ! %s/%d -j ACCEPT", network, slashnet);
rc = vnetApplySingleTableRule(vnetconfig, "filter", cmd);

snprintf(cmd, 256, "-A POSTROUTING -d ! %s/%d -s ! 127.0.0.0/8 -j MASQUERADE", network, slashnet);
snprintf(cmd, 256, "-A POSTROUTING -d ! %s/%d -s %s/%d -j MASQUERADE", network, slashnet, network, slashnet);
rc = vnetApplySingleTableRule(vnetconfig, "nat", cmd);

rc = vnetSetMetadataRedirect(vnetconfig, network, slashnet);
Expand Down

0 comments on commit abb7ea4

Please sign in to comment.