Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all. I ask for the help of specialists, as my head is already spinning. There are two Centos 7 servers, the Carp protocol is configured on them. It works and ip goes from one server to another when the main one goes down. On the local network everything works perfectly. The problem begins when there is a communication in other subnet. For clarity, I give an example:
Master:
VIP_ADDRESS="192.168.98.210"
ID=001
PASSFILE=/etc/ucarp/vip-001.pwd
BIND_INTERFACE="eth0"
SOURCE_ADDRESS="192.168.98.214"
OPTIONS="-k 2 --shutdown --preempt"
Added net.ipv4.ip_nonlocal_bind=1 option to kernel
There is a server that has ip 192.168.120.15, we start ping it from 192.168.98.214 (Master)
10:38:38.315935 IP 192.168.98.214 > 192.168.121.15: ICMP echo request, id 17900, seq 2, length 64
10:38:38.315996 IP 192.168.121.15 > 192.168.98.214: ICMP echo reply, id 17900, seq 2, length 64
Trying a reverse ping to the cluster ip
10:40:26.227616 IP 192.168.121.15 > 192.168.98.210: ICMP echo request, id 17969, seq 2, length 64
10:40:26.227658 IP 192.168.98.210 > 192.168.121.15: ICMP echo reply, id 17969, seq 2, length 64
On reverse ping everything goes right. How to make it so that the routing would go from the cluster ip?????
Hi all. I ask for the help of specialists, as my head is already spinning. There are two Centos 7 servers, the Carp protocol is configured on them. It works and ip goes from one server to another when the main one goes down. On the local network everything works perfectly. The problem begins when there is a communication in other subnet. For clarity, I give an example:
Master:
VIP_ADDRESS="192.168.98.210"
ID=001
PASSFILE=/etc/ucarp/vip-001.pwd
BIND_INTERFACE="eth0"
SOURCE_ADDRESS="192.168.98.214"
OPTIONS="-k 2 --shutdown --preempt"
Added net.ipv4.ip_nonlocal_bind=1 option to kernel
There is a server that has ip 192.168.120.15, we start ping it from 192.168.98.214 (Master)
10:38:38.315935 IP 192.168.98.214 > 192.168.121.15: ICMP echo request, id 17900, seq 2, length 64
10:38:38.315996 IP 192.168.121.15 > 192.168.98.214: ICMP echo reply, id 17900, seq 2, length 64
Trying a reverse ping to the cluster ip
10:40:26.227616 IP 192.168.121.15 > 192.168.98.210: ICMP echo request, id 17969, seq 2, length 64
10:40:26.227658 IP 192.168.98.210 > 192.168.121.15: ICMP echo reply, id 17969, seq 2, length 64
On reverse ping everything goes right. How to make it so that the routing would go from the cluster ip?????
I found a solution
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW ! -s 192.168.98.210 -j SNAT --to-source 192.168.98.210
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.