0

I have server ubuntu whit 2 network card and i want output 1 lan for postfix and dns, other lan for http ,dns, ftp etc. My configuracion is :

uname -a
Linux mail.domain.com 5.15.0-72-generic #79-Ubuntu SMP Wed Apr 19 08:22:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.18.1    0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eth1
0.0.0.0         192.168.18.1    0.0.0.0         UG    100    0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 eth1
192.168.1.1     0.0.0.0         255.255.255.255 UH    100    0        0 eth1
192.168.18.0    0.0.0.0         255.255.255.0   U     100    0        0 eth0
192.168.18.1    0.0.0.0         255.255.255.255 UH    100    0        0 eth0

Now send mail only from eth0 and I need exit only from eth1 because have reverse from this. if bind postfix in eth1 not send and in log see not conected timed out. If change default route to eth1 work send mail and dns but not work http dns ftp in eth0 , i think problem is from route but is is newbie in Linux.

cianyika
  • 1
  • 2
  • Does this answer your question? [Does inet\_interfaces bind outgoing mail when more than one address is specified?](https://serverfault.com/questions/688810/does-inet-interfaces-bind-outgoing-mail-when-more-than-one-address-is-specified) – Gerald Schneider May 18 '23 at 04:49
  • i rezolved whit this : ip route add 192.168.1.0/24 dev eth1 table rt2 ip route add default via 192.168.1.1 dev eth1 table rt2 ip rule add from 192.168.1.0/24 table rt2 ip rule add to 192.168.1.0/24 table rt2 and add 2 line in postfix config : inet_interfaces = 192.168.1.254, 127.0.0.1 smtp_bind_address = 192.168.1.254 this is and working , tnx all – cianyika May 18 '23 at 17:07
  • Please post your solution as an answer and accept it, otherwise the question will stay in the system as unsolved forever – Gerald Schneider May 18 '23 at 20:36

0 Answers0