|
|
ru.unix.bsd- RU.UNIX.BSD ------------------------------------------------------------------ From : Alexey Ghindarev 2:5020/1368 13 Oct 2005 22:36:10 To : All Subject : Natd globalports --------------------------------------------------------------------------------
Тут и я собpал всю свою силу воли и написал,
Пpиветствую тебя, All!
Ктонибудь пользовался сабжем в freebsd, появилось в основной ветке начиная с
5.3. В мане не появилось,удалось найти пример автора изначального автора,но он
почемуто работает тока через один интерфейс... Толи с роутингом чтото не то толи
у меня с головой,я не сильно силе в этом всем.... даю цитаты...
http://www.freebsd.org/releases/5.3R/relnotes-i386.html
natd(8) now supports multiple instances via a new option globalports. This
allows natd(8) to bind to different network interfaces and share load.
http://phk.freebsd.dk/misc/natd/notes.natd
OK, I got it working now.
Here's the setup:
212.242.86.136/26 ----------- sis0
sis1 ----------- 10.0.0.1/24
212.242.86.183/29 ----------- sis2
Default route is out via sis0.
I can connect to the interor machine (10.0.0.2) on port 122 through
both exterior IP#, and outgoing connections choose a path randomly
as far as I can tell.
The way this works is that natd.conf builds two instances of the
aliasing engine (one of them have to be named "default" right now
or natd will refuse to start).
In addition to these instances private divert sockets, a third
socket called the "globalport" is created, packets sent to natd
via this one will be matched against all instances and translated
if an existing entry is found and unchanged if no entry is found.
Poul-Henning
natd.conf:
log
deny_incoming
verbose
instance default
interface sis0
port 1000
redirect_port tcp 10.0.0.2:122 122
instance sis2
interface sis2
port 2000
redirect_port tcp 10.0.0.2:122 122
globalport 3000
ipfw:
ipfw -f flush
ipfw add allow ip from any to any via sis1
ipfw add skipto 1000 ip from any to any in via sis0
ipfw add skipto 2000 ip from any to any out via sis0
ipfw add skipto 3000 ip from any to any in via sis2
ipfw add skipto 4000 ip from any to any out via sis2
ipfw add 1000 count ip from any to any
ipfw add divert 1000 ip from any to any
ipfw add allow ip from any to any
ipfw add 2000 count ip from any to any
ipfw add divert 3000 ip from any to any
ipfw add allow ip from 212.242.86.136 to any
ipfw add allow ip from 212.242.86.183 to any
ipfw add prob .5 skipto 4000 ip from any to any
ipfw add divert 1000 ip from any to any
ipfw add allow ip from any to any
ipfw add 3000 count ip from any to any
ipfw add divert 2000 ip from any to any
ipfw add allow ip from any to any
ipfw add 4000 count ip from any to any
ipfw add divert 2000 ip from any to any
ipfw add allow ip from any to any
как говорится,поможите чем можите...
Алексей
... Хаос с маленькой буквы - Бардак!
--- GED+2 секpетутки pостом 1.1.5-30120 метра. Under OS/2 ver. 4.51 rev. 14.093
* Origin: --== Мысли Пачкают Мозги! ==-- (2:5020/1368)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.unix.bsd/22120434eabbe.html, оценка из 5, голосов 10
|