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
I have ubuntu server with 2 WAN interfaces - 2 ISP. If request comes to ISP1 the answer is delivered through WAN1. Same with ISP2 - incoming requests to WAN2 are routed back through WAN2. So WAN1 is for ISP1, and WAN2 is for ISP2. Everything works well until one condition. If the request comes to WAN1 from the IP which belongs to ISP2 subnet, the answer do not come from WAN1, but from WAN2 (ISP2). Same happens if the request comes to WAN2 (ISP2), but the client IP belongs to ISP1 subnet, the server tries to deliver the answer through WAN1, not WAN2 as it should be. How I can change this?
If the request comes to WAN1 from the IP which belongs to ISP2 subnet, the answer do not come from WAN1, but from WAN2 (ISP2). Same happens if the request comes to WAN2 (ISP2), but the client IP belongs to ISP1 subnet, the server tries to deliver the answer through WAN1, not WAN2 as it should be. How I can change this?
How do you know that ? Could you provide some more detailed information - commands, replies ?
How do you know that ? Could you provide some more detailed information - commands, replies ?
I know, because it is happening like I described. The ISP1 do not answer to IP that is from ISP2 subnet and ISP2 do not answer to IP that is from ISP1 subnet.
Hi
I have ubuntu server with 2 WAN interfaces - 2 ISP. If request comes to ISP1 the answer is delivered through WAN1. Same with ISP2 - incoming requests to WAN2 are routed back through WAN2. So WAN1 is for ISP1, and WAN2 is for ISP2. Everything works well until one condition. If the request comes to WAN1 from the IP which belongs to ISP2 subnet, the answer do not come from WAN1, but from WAN2 (ISP2). Same happens if the request comes to WAN2 (ISP2), but the client IP belongs to ISP1 subnet, the server tries to deliver the answer through WAN1, not WAN2 as it should be. How I can change this?
Without knowing more, the short answer is this is a routing issue. So, add/change your routes. You've only told us "ubuntu server", and nothing else.
root@server:/# ip route
65.65.128.0/18 dev em4 proto kernel scope link src 65.65.141.40
65.65.191.254 dev em4 scope link src 65.65.141.40
85.85.188.0/22 dev em1 proto kernel scope link src 85.85.191.157
85.85.191.254 dev em1 scope link src 85.85.191.157
192.168.1.0/24 dev em2 proto kernel scope link src 192.168.1.55
root@server:/# ip rule
0: from all lookup local
999: from all lookup main
10000: from all fwmark 0x65/0xff lookup ISP1
10002: from all fwmark 0x67/0xff lookup ISP2
20000: from 85.85.191.157 lookup ISP1
20000: from 65.65.141.40 lookup ISP2
32765: from all lookup balance
32767: from all lookup default
root@server:/# ip route
65.65.128.0/18 dev em4 proto kernel scope link src 65.65.141.40
65.65.191.254 dev em4 scope link src 65.65.141.40
85.85.188.0/22 dev em1 proto kernel scope link src 85.85.191.157
85.85.191.254 dev em1 scope link src 85.85.191.157
192.168.1.0/24 dev em2 proto kernel scope link src 192.168.1.55
root@server:/# ip rule
0: from all lookup local
999: from all lookup main
10000: from all fwmark 0x65/0xff lookup ISP1
10002: from all fwmark 0x67/0xff lookup ISP2
20000: from 85.85.191.157 lookup ISP1
20000: from 65.65.141.40 lookup ISP2
32765: from all lookup balance
32767: from all lookup default
File: /etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
250 balance
0 unspec
#
# local
#
1 ISP1
3 ISP2
Ok, again...need actual information. You posted these things with (again) no context, told us anything past "ubuntu server" (how about the version??) What program(s)/application(s) are handling these requests, what the requests actually ARE, etc. We have zero idea past very broad strokes on what to tell you since there is no information to work with.
I know, because it is happening like I described. The ISP1 do not answer to IP that is from ISP2 subnet and ISP2 do not answer to IP that is from ISP1 subnet.
Could you provide us traceroute reply how "...the answer do not come from WAN1, but from WAN2 (ISP2)" and "...the server tries to deliver the answer through WAN1, not WAN2 as it should be" ?
It is not easy to show it. Simply believe me how it works. The request from ISP2 subnet comes to WAN1(ISP1), the server routes the answer not bock to the WAN1, but to the WAN2(ISP2), because there is no answer to client. I suppose the server thinks that this request came from WAN2(ISP2) or default routing tables are working. If the request to the WAN1(ISP1) comes not from ISP2 subnet, everything works fine - iproutes2 tables routes the answer back to the WAN1.
Another example. The default (with max weight) gateway is WAN1. All "ip route get <IP>" goes through WAN1(ISP1) gateway. But if I try to get the route to the IP which belongs to the ISP2 subnet, the server offers WAN2(ISP2) gateway. So I think the server routes all the incoming requests via WAN ports in same way.
It is not easy to show it. Simply believe me how it works. The request from ISP2 subnet comes to WAN1(ISP1), the server routes the answer not bock to the WAN1, but to the WAN2(ISP2), because there is no answer to client. I suppose the server thinks that this request came from WAN2(ISP2) or default routing tables are working. If the request to the WAN1(ISP1) comes not from ISP2 subnet, everything works fine - iproutes2 tables routes the answer back to the WAN1.
Another example. The default (with max weight) gateway is WAN1. All "ip route get <IP>" goes through WAN1(ISP1) gateway. But if I try to get the route to the IP which belongs to the ISP2 subnet, the server offers WAN2(ISP2) gateway. So I think the server routes all the incoming requests via WAN ports in same way.
And you *STILL* don't answer any of the questions asked. Restating it doesn't offer more information.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.