Роутер, который смотрит на зверей:
#rc.firewall
# Add some local networks to table(5)
${fwcmd} table 5 flush
${fwcmd} table 5 add 10.0.0.0/8
${fwcmd} table 5 add 194.126.204.0/24
${fwcmd} table 5 add 192.168.0.0/16
......
......
# Redirect users with no NoDeny connection to special web page
${fwcmd} add 120 skipto 130 all from 'table(1)' to any out via ${ext_if}
${fwcmd} add 121 skipto 130 all from any to 'table(1)' in via ${ext_if}
${fwcmd} add 122 divert natd tcp from 'table(5)' to not 10.1.10.100,10.1.10.16 dst-port 80 out via ${ext_if}
${fwcmd} add 123 divert natd tcp from 10.1.10.100 10080 to me in via ${ext_if}
${fwcmd} add 124 allow tcp from 'table(5)' to any dst-port 80
${fwcmd} add 125 allow tcp from any 80 to 'table(5)'
...........
..........
# natd.conf
log no
use_sockets yes
same_ports yes
verbose no
log_ipfw_denied yes
unregistered_only yes
#
proxy_rule port 80 server 10.1.10.100:10080
Лезем на соседний сервак
ставим nginx
# nginx.conf$ less nginx.conf
user www;
worker_processes 7;
error_log /var/log/nginx/error.log;
events {
worker_connections 256;
}
http {
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
tcp_nopush on;
# Limit Zone
limit_zone one $binary_remote_addr 10m;
## Added by Andrey Zentavr
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
## End
server {
listen 10.1.10.100:10080;
#server_name drop.xxx;
access_log /var/log/nginx/drop.xxx.access_log main;
location /index.html {
root /www/drop.xxx;
}
location /linet_small_vlogo.gif {
root /www/drop.xxx;
}
location /style.css {
root /www/drop.xxx;
}
location / {
root /www/drop.xxx;
error_page 404 /index.html;
rewrite .*\.gif$ /linet_small_vlogo.gif last;
rewrite .*\.css$ /style.css last;
rewrite ^.* /index.html last;
}
}
}