last day (15 days later) » 

21:33
0
Q: I can't ping to a local IP of server A from server B creating a static route.

VaToI’m trying to create a static route between two servers, server A and server B, I created the static route from server B to server A so I could ping to a docker container in server A. Server A details: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:0...

Did you add a route on server A so it knows how to reply?
I didn't add any route on server A. Could you please explain more on what you are saying? Thank you!
Communication is a two-way problem. Just because B knows the route to A, it doesn't mean that A knows the route to B. So A can't reply to the pings.
Are you saying that I need to add a new route from A to B or open ports in the firewall?
You need a route from A to B. And you have to allow ICMP through the firewall (there are no ports for ICMP).
21:33
I did this on my server A> sudo iptables -A INPUT -p icmp -i eth0 -j ACCEPT and still is not getting any response back when pinging.
Did you add the route? Or does its default route point to the appropriate router already?
You mean the route I already created in server B? Yes it's already there.
No, the route in A that I keep asking about. Ping is 2 way. B sends a message to A, then A has to send a response to B. If A doesn't have a route to B, it can't send the response.
Hello
21:33
I hope you don't mind moving this discussion here
no problem
and thank you for your help by the way
so now I'm thinking in how I can add the route in server A to Server B, I just thought I had to do it in only one way.
The same way you added the route in B.
ok let me check
ip route add 172.31.0.0/24 via 172.17.x.x dev eth0
where 172.17.x.x is the address of the router that connects the two networks.
21:36
the router? that would be the same ip as Server B
so same ip where I'm executing this command
Ahh, I didn't look at your details close enough.
So 172.17 and 172.31 aren't really different networks, one of them is a virtual network in the docker container
yes
it's a local ip to the server A
and I'm trying to see that IP from the server B, but Server A and server B are on the same network
Maybe this is a docker issue, I'm not familiar with it.
well, I took docker as an example
I don't really care about that
I'm studying to create static routes
But if you weren't using docker you'd have real networks, so the two servers wouldn't both have 172.31 addresses.
21:40
and that's what I thought would be a good exercise
I think then the problem is in the /24
In the normal case each server just has an address on one network, and there's a router in between that has interfaces on each network. Docker makes it more confusing.
how can I cover 172.x.x.x?
is that /40?
sorry, I really don't know networks that well
That's /8
But /20 should cover both 172.31.124 and 172.31.126
it seems like with /24 I'm only covering 172. 17.x.x
You're talking about the route from B. That's fine.
21:42
oh ok that's not the issue then?
/24 covers all of 172.17.0.x
I would like to cover 172.x.x.x
sudo ip route add 172.0.0.0/8 via 172.31.124.249 dev eth0
so this would do it?
That's not a good idea, since that includes many public networks.
that's ok, I would like to just test it and delete it
The private address range is 172.16.x.x - 172.31.x.x, which is 172.16.0.0/12
But if you want to do that, it's /8
21:48
how can I add a route?
sorry, delete
But I really think the problem has something to do with the docker virtualization, not the route from B to A.
The Server A details you posted, are they of the real machine or the docker container?
well, if that is the problem, do you have any other way that I can test if my setup is working?
Server A and B are VMs
So you have virtual machines, and then you're running docker inside one of the VMs?
the only docker container I have is the ip 172.17.x.x
correct
as you can see in the post under Server A details
If you want to simulate a real network, create 3 VMs, no docker. Server A on 172.17, Server B on 172.31, and routerC with interfaces on both networks.
21:53
so two interfaces for routerc?
right
damn, I don't think I can do that
it's pretty limited
I can't even change the ip of the VMs
but I think I understand what is going on
Sorry, assumed you had more flexibility. I suggest you look into what's going on in docker's networking setup. I don't know enough about docker to tell you what to look for.
It might just need some kind of default gateway.
good luck with the rest
ok thank you Bamar
Barmar

last day (15 days later) »