Возможно вы искали: 'Dicey, A Dice Game of ...'

May 15 2025 18:32:02
  • Как сделать 8Gamers.Ru домашней страницей?
  • Игры
    • База данных по играх
    • Игровые новости
    • Игровая индустрия
    • Обзоры на игры
    • Прохождения игр
    • Гайды к играм
    • Превью о играх
    • Игровые тизеры
    • Игровые арты
    • Игровые обои
    • Игровые скриншоты
    • Игровые обложки
    • Игровые трейлеры
    • Игровое видео
    • Вышедшие игры
    • Ближайшие релизы игр
  • Кино и ТВ
    • База данных по кино
    • Статьи о кино
    • Постеры
    • Кадры из кино
    • Кино трейлеры
    • Сегодня в кино
    • Скоро в кино
  • Комиксы и манга
    • Манга по алфавиту
    • База данных по комиксах
    • Читать онлайн комиксы
    • Читать онлайн манга
    • База персонажей
  • Читы и коды
    • Чит-коды для PC игр
    • Чит-коды для консольных игр
    • Трейнеры
    • Коды Game Genie
  • Моддинг
    • Модификации
    • Карты к играм
    • Программы для моддинга
    • Статьи о моддинге
  • Геймдев
    • Всё о создании игр
    • Список движков
    • Утилиты в помощь игроделу
    • Конструкторы игр
    • Игровые движки
    • Библиотеки разработки
    • 3D-модели
    • Спрайты и тайлы
    • Музыка и звуки
    • Текстуры и фоны
  • Рецензии
    • Игры
    • Кино
    • Аниме
    • Комиксы
    • Мангу
    • Саундтреки
  • Саундтреки
    • Лирика
  • Файлы
    • Патчи к играм
    • Русификаторы к играм
    • Сохранения к играм
    • Субтитры к кино
  • Медиа
    • Видео
    • Фото
    • Аудио
    • Фан-арты
    • Косплей
    • Фото с виставок
    • Девушки из игр
    • Рисунки
    • Рисуем онлайн
    • Фотохостинг
  • Юмор
    • Анекдоты
    • Афоризмы
    • Истории
    • Стишки и эпиграммы
    • Тосты
    • Цитаты
  • Флеш
    • Азартные
    • Аркады
    • Бродилки
    • Гонки
    • Для девочек
    • Для мальчиков
    • Драки
    • Квесты
    • Леталки
    • Логические
    • Мультфильмы
    • Открытки
    • Приколы
    • Разное
    • Спорт
    • Стратегии
    • Стрелялки
Статистика

Статей: 87772
Просмотров: 96111483
Игры
Injustice:  Gods Among Us
Injustice: Gods Among Us
...
Dark Souls 2
Dark Souls 2
Dark Souls II - вторая часть самой хардкорной ролевой игры 2011-2012 года, с новым героем, сюжето...
Battlefield 4
Battlefield 4
Battlefield 4 - продолжение венценосного мультиплеер-ориентированного шутера от первого ли...
Кино
Steins;Gate
Steins;Gate
Любители японской анимации уже давно поняли ,что аниме сериалы могут дать порой гораздо больше пи...
Ку! Кин-дза-дза
Ку! Кин-дза-дза
Начинающий диджей Толик и всемирно известный виолончелист Владимир Чижов встречают на шумной моск...
Обзоры на игры
• Обзор Ibara [PCB/PS2] 18357
• Обзор The Walking ... 18801
• Обзор DMC: Devil M... 19879
• Обзор на игру Valk... 15877
• Обзор на игру Stars! 17764
• Обзор на Far Cry 3 17948
• Обзор на Resident ... 16024
• Обзор на Chivalry:... 17508
• Обзор на игру Kerb... 17981
• Обзор игры 007: Fr... 16619
Превью о играх
• Превью к игре Comp... 17960
• Превью о игре Mage... 14464
• Превью Incredible ... 14721
• Превью Firefall 13479
• Превью Dead Space 3 16334
• Превью о игре SimC... 14730
• Превью к игре Fuse 15442
• Превью Red Orche... 15542
• Превью Gothic 3 16343
• Превью Black & W... 17354
Главная » Статьи » Разное » [FreeBSD] переброс соединения для обработки во внутреннюю сеть NAT (nat freebsd redirect)

[FreeBSD] переброс соединения для обработки во внутреннюю сеть NAT (nat freebsd redirect)

Ключевые слова: nat, freebsd, redirect, (найти похожие документы)

From: Ruslan Ermilov <ru@ucb.crimea.ua>
Subject: [FreeBSD] переброс соединения для обработки во внутреннюю сеть NAT


On Sat, Jul 17, 1999 at 08:03:32AM -0400, Tim Walker wrote:

> I am running FreeBSD as my network's gateway to the Internet and am
> trying to pass Web traffic through to a server on my internal network
> (FreeBSD machine has a routable IP address and the internal web server
> has a non-routable address).
>
> It is working fine from the outside world, but from machines on my
> internal network they always end up on the FreeBSD webserver.
>
> In the natd.conf file I have:
>
> use_sockets yes
> same_ports yes
> interface ed1
> redirect_port tcp 192.168.1.2:80 80
> redirect_port tcp 192.168.1.2:21 21
> redirect_port tcp 192.168.1.2:20 20
>

Looks good.

>
> and in the rc.firewalls file I have:
>
> ipfw add 10 divert natd tcp from 192.168.1.2 80 to any
> ipfw add 11 divert natd tcp from any to 192.168.1.2 80
> ipfw add 12 divert natd tcp from any to 192.168.1.100 80
>
> (192.168.1.2 is the webserver, and 192.168.1.100 is the inside interface of
> the FreeBSD machine).
>
> Does anyone have any suggestions?
>

The following should do the trick:

ipfw add 10 divert natd tcp from any 80 to any
ipfw add 11 divert natd tcp from any to any 80

See the attached message for a more detailed explanation.


Cheers,
--
Ruslan Ermilov Sysadmin and DBA of the
ru@ucb.crimea.ua United Commercial Bank,
ru@FreeBSD.org FreeBSD committer,
+380.652.247.647 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age


From: Ruslan Ermilov
To: Ludwig Pummer

> >> Modified files:
> >> sbin/natd natd.8
> >> Log:
> >> Mention that data going from one internal address to another will
> >> not be processed by natd.
> >> Requested by: Ludwig Pummer
>
> I don't think that's how I worded it...
>
> >> Revision Changes Path
> >> 1.19 +11 -4 src/sbin/natd/natd.8
> >>
> >
> >The text of this change was:
> >} It should be noted that only incoming packets are affected.
> >} ^^^^^^^^
> >} Data going from one internal network to another will not be
> >} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >} processed by natd.
>
> This also isn't quite what I meant...
>
> >I don't understand. Look at my example:
> >
> ># ipfw add 1 divert 6666 tcp from 192.168.1.1 1234 to any
> ># nc -s 192.168.1.1 -p 1234 192.168.1.2 5678
> ># natd -v -p 6666 -a 1.2.3.4 -redirect_port tcp 192.168.1.1:1234 2345
> >Out [TCP] [TCP] 192.168.1.1:1234 -> 192.168.1.2:5678 aliased to
> > [TCP] 1.2.3.4:1234 -> 192.168.1.2:5678
> >
> >It is outgoing packet following from one internal host to another,
> >and it _is_ affected. What did you mean?
>
> I'm not understanding the example very well (what's 'nc' and what is it doing?)
>

/usr/ports/net/netcat - simple utility which reads and writes data across
network connections, very handy.

> Let me restate what I originally said/meant to say:
> I have a machine doing natd. It has an internal network address
> 172.16.1.5/24 and an external network address of 24.2.21.36/24. If I do
> 'redirect_port tcp 172.16.1.30:80 80' and then try to point my web browser
> (from a machine in the 172.16.1.5/24 network) at http://24.2.21.36:80, it
> will not reach 172.16.1.30:80. If, however, I point my web browser (from a
> machine on the internet) at http://24.2.21.36:80, it _will_ reach
> 172.16.1.30:80.
>

Ah, I see now what did you mean, but you're wrong anyway.
It works(!) even in such configuration, look what I did:

Host running natd:

(internal interface 192.168.1.1/24)
fxp0: flags=8843 mtu 1500
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:a0:c9:55:13:22
media: autoselect (10baseT/UTP) status: active
supported media: autoselect 100baseTX 100baseTX 10baseT/UTP 10baseT/UTP

(external interface 212.110.138.1/28)
fxp2: flags=8843 mtu 1500
inet 212.110.138.1 netmask 0xfffffff0 broadcast 212.110.138.15
ether 00:a0:c9:5a:51:f9
media: manual
supported media: manual


# ipfw list 1
00001 divert 6666 tcp from any to any 80
00001 divert 6666 tcp from any 80 to any

** Note that there are no "via" keywords, otherwise it will not work.

# natd -v -p 6666 -n fxp2 -u -redirect_port tcp 192.168.1.13:80 80

(telnet from 192.168.1.3 to 212.110.138.1:80)
In [TCP] [TCP] 192.168.1.3:4138 -> 212.110.138.1:80 aliased to
[TCP] 192.168.1.3:4138 -> 192.168.1.13:80
Out [TCP] [TCP] 192.168.1.3:4138 -> 192.168.1.13:80 aliased to
[TCP] 212.110.138.1:4138 -> 192.168.1.13:80

(reply from 192.168.1.13:80)
In [TCP] [TCP] 192.168.1.13:80 -> 212.110.138.1:4138 aliased to
[TCP] 192.168.1.13:80 -> 192.168.1.3:4138
Out [TCP] [TCP] 192.168.1.13:80 -> 192.168.1.3:4138 aliased to
[TCP] 212.110.138.1:80 -> 192.168.1.3:4138

(telnet from 212.110.138.4 to 212.110.138.1:80)
In [TCP] [TCP] 212.110.138.4:49247 -> 212.110.138.1:80 aliased to
[TCP] 212.110.138.4:49247 -> 192.168.1.13:80
Out [TCP] [TCP] 212.110.138.4:49247 -> 192.168.1.13:80 aliased to
[TCP] 212.110.138.4:49247 -> 192.168.1.13:80

(reply from 192.168.1.13:80)
In [TCP] [TCP] 192.168.1.13:80 -> 212.110.138.4:49247 aliased to
[TCP] 192.168.1.13:80 -> 212.110.138.4:49247
Out [TCP] [TCP] 192.168.1.13:80 -> 212.110.138.4:49247 aliased to
[TCP] 212.110.138.1:80 -> 212.110.138.4:49247


> I felt that despite this being logical according to routing and the way the
> ipfw rule is written**, this was worth pointing out. Otherwise, many
> newbies setting up natd for the first time would do something very similar
> to my example above, and become disappointed/discouraged/confused when they
> can't connect to http://24.2.21.36:80 from their inside machine. I came to
> this conclusion after helping someone with natd over ICQ, and then
> recalling that I had similar problems when I was first playing with natd.
>

I hope you're ready to do it now!

> ** This is my thinking: Packets addressed to 24.2.21.36:80 from an inside
> machine are not actually sent out via the external network interface and
> then back, because the address is recognized as belonging to the computer
> running natd. Instead, the packets are just routed over the loopback
> network interface. Because the packets are never sent in and out via the
> interface listed in the ipfw rule, they are never sent through natd and
> therefore are not redirected to 172.16.1.30:80.
>

No, you misunderstood the concept. It is very simple, in fact:
There are two kinds of packets, "incoming" and "outgoing".

Outgoing packets are "aliased", i.e. their source IP address is replaced
by the "aliasing" address.

And vice versa, incoming packets are "de-aliased", i.e. their destination
IP address (which is equal to one of the "aliasing" addresses, yes, there
can be more than one) is looked for in the internal natd's mapping table,
which is created "on the fly" and by "redirect" rules.

Whether the packet is considered an "incoming" or "outgoing", depends on
how the natd has been run.

If run with ``-p port'', then the rules described in divert(4) take place.

You can override this by running natd with "-i inport" and "-o outport".
This will instruct natd to treat all packets from "inport" as being
"incoming", and permorm "de-aliasing" for them, and all packets from
"outport" as "outgoing", and perform "aliasing" for them.
It gives you more flexibility, but unneeded in most cases.

Another option that changes this behaviour is "-reverse" option.

One important thing that should be taken into the account is the ipfw's
configuration. You should make sure to configure it properly, I think
you understood this from my example.


Cheers,
--
Ruslan Ermilov Sysadmin and DBA of the
ru@ucb.crimea.ua United Commercial Bank,
ru@FreeBSD.org FreeBSD committer,
+380.652.247.647 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
677 Прочтений •  [[FreeBSD] переброс соединения для обработки во внутреннюю сеть NAT (nat freebsd redirect)] [08.05.2012] [Комментариев: 0]
Добавил: Ukraine Vova
Ссылки
HTML: 
[BB Url]: 
Похожие статьи
Название Добавил Добавлено
• [FreeBSD] переброс соединения для о... Ukraine Vova 08.05.2012
Ни одного комментария? Будешь первым :).
Пожалуйста, авторизуйтесь для добавления комментария.

Проект входит в сеть сайтов «8Gamers Network»

Все права сохранены. 8Gamers.NET © 2011 - 2025

Статьи
Рецензия на Pressure
Рецензия на Pressure
Чтобы обратить на себя внимание, начинающие маленькие разработчики, как правило, уходят в жанры, ...
Рецензия на Lost Chronicles of Zerzura
Рецензия на Lost Chron...
Игры, сделанные без любви и старания, похожи на воздушный шар – оболочка есть, а внутри пусто. Lo...
Рецензия на The Bridge
Рецензия на The Bridge
«Верх» и «низ» в The Bridge — понятия относительные. Прогуливаясь под аркой, можно запросто перей...
Рецензия на SimCity
Рецензия на SimCity
Когда месяц назад состоялся релиз SimCity, по Сети прокатилось цунами народного гнева – глупые ош...
Рецензия на Strategy & Tactics: World War 2
Рецензия на Strategy &...
Название Strategy & Tactics: World War II вряд ли кому-то знакомо. Зато одного взгляда на ее скри...
Рецензия на игру Scribblenauts Unlimited
Рецензия на игру Scrib...
По сложившейся традиции в информационной карточке игры мы приводим в пример несколько похожих игр...
Рецензия на игру Walking Dead: Survival Instinct, The
Рецензия на игру Walki...
Зомби и продукция-по-лицензии — которые и сами по себе не лучшие представители игровой биосферы —...
Обратная связь | RSS | Донейт | Статистика | Команда | Техническая поддержка