URL: https://www.opennet.ru/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 82253
[ Назад ]

Исходное сообщение
"NAT в ядре синтаксис?"

Отправлено alex123 , 03-Окт-08 16:55 
Народ, кто нить разберался с синтаксисом NAT в ядре фри 7 (option FIREWALL_NAT)
как правильно записать нат для двух интерфейcов rl1 и rl0, надо чтоб rl1(LAN) маскировался rl0(INTERNET)

Содержание

Сообщения в этом обсуждении
"NAT в ядре синтаксис?"
Отправлено alex123 , 03-Окт-08 17:04 
Вот что нашёл по етому поводу:

   NAT, REDIRECT AND LSNAT
     First redirect all the traffic to nat instance 123:

       ipfw add nat 123 all from any to any

     Then to configure nat instance 123 to alias all the outgoing traffic with
     ip 192.168.0.123, blocking all incoming connections, trying to keep same
     ports on both sides, clearing aliasing table on address change and keep-
     ing a log of traffic/link statistics:

       ipfw nat 123 config ip 192.168.0.123 log deny_in reset same_ports

     Or to change address of instance 123, aliasing table will be cleared (see
     reset option):

       ipfw nat 123 config ip 10.0.0.1

     To see configuration of nat instance 123:

       ipfw nat 123 show config

     To show logs of all the instances in range 111-999:

       ipfw nat 111-999 show

     To see configurations of all instances:

       ipfw nat show config

     Or a redirect rule with mixed modes could looks like:

       ipfw nat 123 config redirect_addr 10.0.0.1 10.0.0.66
               redirect_port tcp 192.168.0.1:80 500
               redirect_proto udp 192.168.1.43 192.168.1.1
               redirect_addr 192.168.0.10,192.168.0.11
                   10.0.0.100 # LSNAT
               redirect_port tcp 192.168.0.1:80,192.168.0.10:22
                   500          # LSNAT

     or it could be splitted in:

       ipfw nat 1 config redirect_addr 10.0.0.1 10.0.0.66
       ipfw nat 2 config redirect_port tcp 192.168.0.1:80 500
       ipfw nat 3 config redirect_proto udp 192.168.1.43 192.168.1.1
       ipfw nat 4 config redirect_addr
       192.168.0.10,192.168.0.11,192.168.0.12
                    10.0.0.100
       ipfw nat 5 config redirect_port tcp
              192.168.0.1:80,192.168.0.10:22,192.168.0.20:25 500
но санглийским у меня плохо, не понимаю ..... :(((