1. Нужно организовать трансляцию адресов по следующему принципу:
192.168.1.12 <---> Ext.IP-1
192.168.1.13 <---> Ext.IP-2
192.168.1.14-20 <---> Ext.IP-3
2. На каждом таком соответствии рулить приоритет и скорость (это потом - pipe, queue). Не получается сделать пока NAT.
3. FreeBSD 8.2, использую IPFW.
Код: Выделить всё
klitor# uname -a
FreeBSD klitor 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Mar 29 16:44:57 UTC 2012 root@:/usr/src/sys/i386/compile/GATEWAY i386
Код: Выделить всё
klitor# cat /etc/rc.conf
keymap="ru.koi8-r"
sshd_enable="yes"
ifconfig_em1="inet 188.168.X.24 netmask 255.255.255.0"
fconfig_em1_alias0="188.168.X.22 netmask 255.255.255.0"
ifconfig_em0="inet 192.168.1.254 netmask 255.255.255.0"
defaultrouter="188.168.X.17"
hostname="klitor"
firewall_enable="YES"
firewall_script="/etc/firewall.conf"
natd_enable="YES"
natd_interface="em1"
natd_flags="-f /etc/natd.conf"
gateway_enable="yes"
Код: Выделить всё
klitor# cat /etc/firewall.conf
#!/bin/sh
ipfw -q flush
wan="em1"
lan="em0"
wan_ip="188.168.X.24"
lan_ip="192.168.1.254"
ipfw add 0100 allow ip from any to any via lo0
ipfw add 0101 deny ip from any to 127.0.0.0/8
ipfw add 0102 deny ip from 127.0.0.0/8 to any
ipfw add 1000 divert natd all from any to any via $wan
Код: Выделить всё
klitor# cat /etc/natd.conf
alias_address 188.168.X.22
redirect_address 192.168.1.12 188.168.X.22