0

I am trying to run OSRM docker on remote machine. I followed setup instructions which are mention on https://github.com/Project-OSRM/osrm-backend

wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf

docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf

docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm

docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm

After executing above instruction I am able to run docker and I am able to get the local result.

// this gives me proper response.
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"

// but when I tried with my remote machine IP then is giving
// Failed to connect to my_remote_ip port 5000: Connection timed out
curl "http://my_remote_ip:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
3
  • 1
    Based on what you posted, it only looks like the instance doesn't have any firewall rules for incoming traffic. Have you tried adding them?
    – yyyyahir
    Commented Mar 9, 2020 at 12:07
  • @yyyyahir thanks for replay. I checked firewall rules. After updating firewall rules it is started working fine. Thanks for help.
    – nilkash
    Commented Mar 11, 2020 at 12:39
  • Added an answer to clarify how GCE firewall works in these instances.
    – yyyyahir
    Commented Mar 11, 2020 at 18:11

1 Answer 1

1

Just posting an answer based on my comment to explain the firewall scopes when working with GCE instances.

The Linux/Windows firewall rules (iptables, firewalld, etc.) will work at operating system level. However, consider that the instance itself exists within a VPC, which operates its own firewall rules.

This means that if you have an incoming request, it'll hit the VPC first before getting into the instance. This means that you need to manage traffic at GCE firewall level separately from your OS firewall.

The VPC firewall also controls traffic going from the instance to the internet and from instance to instance:

Firewall rules apply to both outgoing (egress) and incoming (ingress) traffic in the network. Firewall rules control traffic even if it is entirely within the network, including communication among VM instances.

At the end, you have to consider configuring rules in both places to avoid this type of scenarios.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.