Войти

Показать полную графическую версию : Postfix и три сетевых интерфейса.


BachiStil
08-09-2009, 13:14
Здравствуйте. Подскажите пожалуйста как в Postfix указать интерфейс, через который отправлять письма.

[mzd]
08-09-2009, 16:22
В /etc/postfix/main.cf укажите параметр inet_interfaces = ваш_интерфейфс

BachiStil
09-09-2009, 07:54
[mzd], Параметр inet_interfaces указывает все адреса сетевых интерфейсов, на которых Postfix должен ждать соединений.
А мне надо указать через какой письма будут уходить в inet.

WhitePangolin
09-09-2009, 08:39
smtp_bind_address (default: empty)

An optional numerical network address that the Postfix SMTP client should bind to when making an IPv4 connection.

This can be specified in the main.cf file for all SMTP clients, or it can be specified in the master.cf file for a specific client, for example:

/etc/postfix/master.cf:
smtp ... smtp -o smtp_bind_address=11.22.33.44

Note 1: when inet_interfaces specifies no more than one IPv4 address, and that address is a non-loopback address, it is automatically used as the smtp_bind_address. This supports virtual IP hosting, but can be a problem on multi-homed firewalls. See the inet_interfaces documentation for more detail.

Note 2: address information may be enclosed inside [], but this form is not required here.

BachiStil
09-09-2009, 08:40
Может я не верно задал вопрос.
Мне нужно привязать postfix к IP, который выдан провайдером, не являющимся моим шлюзом по умолчанию.
Мне нужно ОТПРАВЛЯТЬ через данный IP почту.

[mzd]
09-09-2009, 10:18
Мне нужно привязать postfix к IP, который выдан провайдером, не являющимся моим шлюзом по умолчанию.
Мне нужно ОТПРАВЛЯТЬ через данный IP почту. »
Вот теперь более понятно.
Тогда вам подойдёт ответ WhitePangolinа.

BachiStil
11-09-2009, 12:26
Есть три интерфейса
vr0 – IpOut1
vr1 – IPOut2
re0 – 10.0.0.12
vr0, vr1 внешние сетевые интерфейсы и соответственно IpOut1, IpOut2 их IP-адреса.
Default Gateway указан 2-ой провайдер.

В main.cf внес:
inet _interfaces = IpOut1, 10.0.0.12

В master.cf:
-o smtp_bind_address=IpOut1

Отправляя письмо, в maillog вижу:
Sep 11 14:36:43 postfix/smtp[41221]: connect to mx1.yandex.ru[77.88.21.89]:25: Operation timed out
Sep 11 14:37:13 postfix/smtp[41221]: connect to mx3.yandex.ru[213.180.204.89]:25: Operation timed out
Sep 11 14:37:43 postfix/smtp[41221]: connect to mx2.yandex.ru[93.158.134.89]:25: Operation timed out


В security
kernel: ipfw: 10120 Accept TCP IpOut1:52999 77.88.21.89:25 out via vr1

Пробовал с помощью setfib назначать таблицу маршрутизации, но не получается.
В rc.firewall добавил правило:
add 09700 setfib 1 ip from IpOut1 to any 25 keep-state

В security
Sep 11 12:04:08 kernel: ipfw: 9700 SetFib 1 TCP IpOut1:53978 213.180.204.89:25 out via vr1
Sep 11 12:04:08 kernel: ipfw: 10120 Accept TCP IpOut1:53978 213.180.204.89:25 out via vr1

WhitePangolin
11-09-2009, 22:34
В master.cf:
-o smtp_bind_address=IpOut1 »
эм... прямо так и написано? вместе с -o? Там же вроде бы как должно быть просто:

smtp_bind_address=IpOut1

если не ошибаюсь, конечно...




© OSzone.net 2001-2012