Changeset 531 for trunk/wifidog/src/fw_iptables.c
- Timestamp:
- 04/01/05 18:25:32 (8 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog/src/fw_iptables.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/fw_iptables.c
r495 r531 158 158 { 159 159 iptables_do_command("-t filter -F " TABLE_WIFIDOG_AUTHSERVERS); 160 iptables_do_command("-t nat -F " TABLE_WIFIDOG_AUTHSERVERS); 160 161 } 161 162 … … 171 172 if (auth_server->last_ip && strcmp(auth_server->last_ip, "0.0.0.0") != 0) { 172 173 iptables_do_command("-t filter -A " TABLE_WIFIDOG_AUTHSERVERS " -d %s -j ACCEPT", auth_server->last_ip); 174 iptables_do_command("-t nat -A " TABLE_WIFIDOG_AUTHSERVERS " -d %s -j ACCEPT", auth_server->last_ip); 173 175 } 174 176 } … … 221 223 iptables_do_command("-t nat -N " TABLE_WIFIDOG_WIFI_TO_INTERNET); 222 224 iptables_do_command("-t nat -N " TABLE_WIFIDOG_UNKNOWN); 225 iptables_do_command("-t nat -N " TABLE_WIFIDOG_AUTHSERVERS); 223 226 224 227 /* Assign links and rules to these new chains */ … … 233 236 iptables_do_command("-t nat -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -j " TABLE_WIFIDOG_UNKNOWN); 234 237 238 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -j " TABLE_WIFIDOG_AUTHSERVERS); 235 239 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -p tcp --dport 80 -j REDIRECT --to-ports %d", gw_port); 236 240 … … 302 306 iptables_do_command("-t mangle -X " TABLE_WIFIDOG_INCOMING); 303 307 304 /* 305 * 306 * Everything in the NAT table 307 * 308 */ 309 debug(LOG_DEBUG, "Destroying chains in the NAT table"); 310 iptables_fw_destroy_mention("nat", "PREROUTING", TABLE_WIFIDOG_OUTGOING); 308 /* 309 * 310 * Everything in the NAT table 311 * 312 */ 313 debug(LOG_DEBUG, "Destroying chains in the NAT table"); 314 iptables_fw_destroy_mention("nat", "PREROUTING", TABLE_WIFIDOG_OUTGOING); 315 iptables_do_command("-t nat -F " TABLE_WIFIDOG_AUTHSERVERS); 311 316 iptables_do_command("-t nat -F " TABLE_WIFIDOG_OUTGOING); 312 317 iptables_do_command("-t nat -F " TABLE_WIFIDOG_WIFI_TO_ROUTER); 313 318 iptables_do_command("-t nat -F " TABLE_WIFIDOG_WIFI_TO_INTERNET); 314 319 iptables_do_command("-t nat -F " TABLE_WIFIDOG_UNKNOWN); 320 iptables_do_command("-t nat -X " TABLE_WIFIDOG_AUTHSERVERS); 315 321 iptables_do_command("-t nat -X " TABLE_WIFIDOG_OUTGOING); 316 322 iptables_do_command("-t nat -X " TABLE_WIFIDOG_WIFI_TO_ROUTER);
