NEWBIE: Creating User for Enrollment using OTT

well, i would still say the intercept depends heavily on IP and port. If you don't have the port intercepted, any extra traffic towards that IP on different ports will effectively be blocked...

As to the next part of your question, I must admit I'm having a hard time visualizing which debian is which...

The intercept.v1 config is used by the tunneler trying to access the service. Whatever address you put in the intercept.v1 will be used by the 'client'.

On the "other side", where the router is that's the "hosting" identity. Any identity can host a service and when you make a 'tunneler enabled' router, you assign an identity to that router so that it can host a service. The entries you put into the host.v1 config are all relative to the identity doing that hosting. In your case that's "Debian 1" i think?

So from "Debian 1" where the edge router is, you offload traffic to "Debian 2" (assuming i have that right)

First, a recap of my testing environment so you can get a better picture of what I would like to do.

  1. Windows laptop with 2 interfaces (onboard Ethernet as 169.254.84.100) connected through a switch to Debian 1 (onboard Ethernet as 169.254.84.101). No gw configured here.
  2. Windows laptop and Debian 1 connected through WiFi (192.168.7.29 and 192.168.7.170 respectively) to a router (interface to the Internet using NAT).
  3. A remote Server somewhere in the Internet (I picked randomly miclaro.claropr.com, one I will never use :o) ).

I created services as www.ziti.com, ftp.ziti.com and ssh.ziti.com, properly intercepted by the Tunneller and correctly sent to Debian 1, where the @ziti-edge-router hosts these 3 services (apache2, ftpd and sshd).

Now I would like to test access to another WWW server, hosted by a "Debian 2" (the server in the Internet). I was thinking in creating another service (claropr.com) in Debian 1 and that the Tunneller would point to miclaro.claropr.com:80 out in the Internet. When I tried this approach I had a DNS solving problem.

I am pretty sure I am missing something important here ...

Assuming you have setup your OpenZiti overlay on your local network this will only work if your local network forwards the OpenZiti traffic through your public IP address to your controller and to your router.

IF you have done that, then the second router (or ziti-edge-tunnel) will be able to connect to your controller and to your edge router.

Can we stop there? Is that the setup? if not, I'm going to need a diagram :slight_smile:

Let me digest what you wrote. I assumed I configured my Host Openziti Anywhere correctly as I could reproduce the results you got in your video. During the installation the eth0.me showed the Router's public IP address (assigned to its WAN interface by the carrier via DHCP). Now, if I did something wrong or it is missing something else to get the mentioned test done I don't know yet. I will digest your notes and create a diagram if necessary to clarify.

Yeah, could not figure it out. Please find diagram of my home network for this test.

Wired network: 169.254.84.x
WiFi network: 192.168.7.x gw 192.168.7.1

Ok. Continuing down the path... From "Debian 2" - can you install the ziti CLI and can you use it to run ziti ops verify-network?

Do that from the Debian2 machine and show me the results?

Should succeed and look like:

Unfortunately I don't have rights to Debian 2. I picked that server randomly. Just to see if I could get to that server from my Windows laptop but passing through the tunnel. If not possible this way I can't test the way I want.

OOOOH i think I understand then... You want to have the client intercept something like "clint.ziti" and have it point to "Debian 2" which in your example was miclaro.claropr.com but it could be google.com or whatever...

Do I understand you now? You want to go to "http://clint.ziti" but SEE traffic from "https://google.com"?

You got it! Of course that I believe in real life all servers would be under IT's control but, just in case ...

Ok - now I understand. That is very helpful.

If you are making a request to an HTTPS resource, it'll be "a problem". HTTP will require the name you dial to match the certificate that's returned or you'll get the scary "security risk" warning that browsers will show you.

Instead, try this. There's a great url out there called http://wttr.in/. It returns back to you the weather but it does this via http OR https. IF you use the http endpoint you won't have any issues.

As an example, here is my wttr.in result:

Make a simple service that looks like this:

Now, when you curl to wttr.in.ziti you'll see i'm magically transported to a different location because my edge router is deployed in AWS:

That make sense? For #1 -- you'd use your identity and for #2 you pick your router (I suspect you'd know this though)

Not yet. Following this approach ...

then when browsing wttr.ziti.com ...

What am I missing? And, yes, I can access directly wttr.in.

you need to be careful and EXPLICITLY type "http".

You typed https ...

Nevermind. EDGE is automatically changing it to 443 ...

I'll see if i can convince edge to use http not https (it happened to me too)

Ugh... Looks like the http url is returning a 301. Let's just add a port 443 mapping as well I guess...

host.v1:

intercept.v1

You'll get "Your connection isn't private" because the cert won't match, that's fine: click advanced -> continue

Yeap! That did the trick! Seems this recipe works for some sites. For my original (claropr.com -> miclaro.claropr.com) it does not. I added 80 and 443 for both host and intercept and it did not work.

This is likely due to your understanding of HTTP or TLS perhaps. Often an HTTP site is backed by a proxy of some kind which looks at the URL you are trying to access and based on that URL certain decisions will be made. The same actually used to be true for wttr.in...

Often it will either be done through something called SNI (server name indication) or by the HTTP server inspecting the http host header.

I can assure you, OpenZiti was working as intended based on your screenshot. The problem is either with SNI or host header, almost certainly but it's not with OpenZiti in that case :slight_smile:

I agree. Openziti is working as expected. I will think about some other tests before I switch to cloud (my next testing phase).

Clint, I am expanding and redoing my tests and made a lot of progress so far. The new network in my lab is as follows ...

I created one entity (sales1) supposed to access just the WEB services in Debian 1 and not in Debian 2. It worked! I created another entity (rh1) supposed to access just the WEB services in Debian 2 and not in Debian 1. It worked!

sales1 is on one laptop (lapsales) and rh1 is on another laptop (laprh).

I created a 3rd entity (itguy) and placed in lapsales. I disabled the entity sales1 and tried to ftp ftpd in Debian 1 and Debian 2 with success. I tried to ssh against Debian 1 and Debian 2 and it worked only for Debian 1. I am checking and rechecking the configuration but could not find anything wrong. In /etc/hosts for Debian 1 and Debian 2 I added ssh1.cb.com (169.254.84.101), ssh2.cb.com (169.254.84.102), ftp1.cb.com (169.254.84.101) and ftp2.cb.com (169.254.84.102) so openziti would not look for DNS names. This is the openziti config for ssh2 related service.

This is the error I get ...

Thanks,

I am not following your test.I don't know what it means when you say, "it worked only for Debian 1". I don't know what that means. You need to look at the logs for the router and the logs for the client. The logs have very helpful messages in them.

In my opinion, you really shouldn't do this in this situation. The hosts file is really easy to change and forget about, and then later on wonder why something doesn't work.

I'd offer you two tips that I think will help, use the policy advisor. There's no zac equivalent of that exactly just yet and it presents information in a pretty succinct mannor. It will inform you as to whether or not you've setup the network and your identity correctly.

using policy advisor

With the ziti CLI issue:

ziti edge policy-advisor identities -q

for example from my earlier wttr test i still have:

OKAY : cdaws-oct31 (1) -> wttr.test (2) Common Routers: (1/1) Dial: Y Bind: N
OKAY : ip-172-31-47-200-edge-router (1) -> wttr.test (2) Common Routers: (1/1) Dial: N Bind: Y

You can also run policy advisor for services:

ziti edge policy-advisor services wttr.test -q
OKAY : cdaws-oct31 (1) -> wttr.test (2) Common Routers: (1/1) Dial: Y Bind: N
OKAY : ip-172-31-47-200-edge-router (1) -> wttr.test (2) Common Routers: (1/1) Dial: N Bind: Y

read the logs

The logs have lots of useful errors in them. If you're not seeing errors, OpenZiti is likely "doing what you asked it to do" and there are other issues that you'll have to resolve.

The reason I used /etc/hosts is that I can't create DNS names in my lab.

In regards to the "worked" or "not" in Debian is as follows.

After creating the identities and downloading their jwt to the respective Windows laptops (lapsales for sales1.jwt and itguy.jwt; laprh for rh1.jwt), creating the proper services in ZAC (wwwsales, wwwrh, ftpdebian1, ftpdebian2, sshdebian1 and sshdebian2) I tested from lapsales laptop ...

  1. browse sales.cb.com (sales.cb.com:80 intercepted and sent to 127.0.0.1:80)
  2. browse rh.cb.com (no interception for this name). I properly got failure to get the related IP address resolution to reach the page.
  3. ftp ftp1.cb.com (ftp1.cb.com:20/21/22 intercepted and sent to 127.0.0.1:80)
  4. ftp ftp2.cb.com (ftp2.cb.com:20/21/22 intercepted and sent to ftp2.cb.com:20/21/22)
  5. ssh ssh1.cb.com (ssh1.cb.com:22 intercepted and sent to 127.0.0.1:22)
  6. ssh ssh2.cb.com (ssh2.cb.com:22 intercepted and sent to ssh2.cb.com:22) ---> DID NOT WORK

Then I tested from laprh laptop ...

  1. browse rh.cb.com (sales.cb.com:80 intercepted and sent to wwwrh.cb.com:80)
  2. browse sales.cb.com (no interception for this name). I properly got failure to get the related IP address resolution to reach the page.

Now, I ran your two suggested commands both on my Windows laptop (lapsales) and Debian 1 and got these errors. Maybe they give some light to the problem.

Windows laptop:

PS C:\Users\Nei> ziti edge policy-advisor identities -q
error: error listing https://24.214.87.28:8441/edge/management/v1/identities?filter=true+skip+0+limit+2 in Ziti Edge Controller. Status code: 401 Unauthorized, Server returned: {
"error": {
"code": "UNAUTHORIZED",
"message": "The request could not be completed. The session is not authorized or the credentials are invalid",
"requestId": "wlETGbkQe"
},
"meta": {
"apiEnrollmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
PS C:\Users\Nei>

Debian 1:

nei@ziti:~/.ziti/quickstart/ziti$ ziti edge policy-advisor services wttr.test -q
error: error listing https://24.214.87.28:8441/edge/management/v1/services?filter=id%3D"wttr.test" in Ziti Edge Controller. Status code: 401 Unauthorized, Server returned: {
"error": {
"code": "UNAUTHORIZED",
"message": "The request could not be completed. The session is not authorized or the credentials are invalid",
"requestId": "ZeI5eikDG"
},
"meta": {
"apiEnrollmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
nei@ziti:~/.ziti/quickstart/ziti$

And related to logs, which logs should I look for?

Thanks,