-
Notifications
You must be signed in to change notification settings - Fork 16.2k
[Teams] Tunnel guides + Gateway tutorial #2114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 187 additions & 0 deletions
187
...lare-one/src/content/connections/connect-apps/install-and-setup/tunnel-guide.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| --- | ||
| order: 3 | ||
| title: Tunnel guide | ||
| pcx-content-type: how-to | ||
| --- | ||
|
|
||
| # Set up your first tunnel | ||
|
|
||
| Follow this step-by-step guide to getting your first tunnel up and running. Before you start, make sure you: | ||
| 1. [Add a website to Cloudflare](https://support.cloudflare.com/hc/en-us/articles/201720164-Creating-a-Cloudflare-account-and-adding-a-website) | ||
| 1. [Change your domain nameservers to Cloudflare](https://support.cloudflare.com/hc/en-us/articles/205195708) | ||
|
|
||
| ## 1. Download and install `cloudflared` | ||
|
|
||
| <details> | ||
| <summary>Windows</summary> | ||
| <div> | ||
|
|
||
| First, download `cloudflared` on your machine. Visit the [downloads](/connections/connect-apps/install-and-setup/installation) page to find the right package for your OS. | ||
|
|
||
| Next, rename the executable to `cloudflared.exe`, and then open PowerShell. Change directory to your Downloads folder and run `.\cloudflared.exe --version`. It should output the version of `cloudflared`. Note that `cloudflared.exe` could be `cloudflared-windows-amd64.exe` or `cloudflared-windows-386.exe` if you haven't renamed it. | ||
|
|
||
| Replace the path in the example with the specifics of your Downloads directory: | ||
|
|
||
| ```text | ||
| PS C:\Users\Administrator\Downloads\cloudflared-stable-windows-amd64> .\cloudflared.exe --version | ||
| ``` | ||
|
|
||
| ### Build from source | ||
|
|
||
| You can also build the latest version of `cloudflared` from source with the following steps: | ||
|
|
||
| ```bash | ||
| $ git clone https://github.com/cloudflare/cloudflared.git | ||
| $ cd cloudflared | ||
| $ make cloudflared | ||
| $ go install github.com/cloudflare/cloudflared/cmd/cloudflared | ||
| ``` | ||
|
|
||
| Depending on where you installed `cloudflared`, you can move it to a known path as well. | ||
|
|
||
| ```bash | ||
| mv /root/cloudflared/cloudflared /usr/bin/cloudflared | ||
| ``` | ||
|
|
||
| </div> | ||
| </details> | ||
|
|
||
| <details> | ||
| <summary>macOS</summary> | ||
| <div> | ||
|
|
||
| The first step to creating a tunnel is to download and install `cloudflared` on your machine. | ||
|
|
||
| ```sh | ||
| $ brew install cloudflare/cloudflare/cloudflared | ||
| ``` | ||
|
|
||
| Alternatively, you can [download the latest Darwin amd64 release](/connections/connect-apps/install-and-setup/installation) directly. | ||
|
|
||
| </div> | ||
| </details> | ||
|
|
||
| <details> | ||
| <summary>Linux</summary> | ||
| <div> | ||
|
|
||
| First, download `cloudflared` on your machine. Visit the [downloads](/connections/connect-apps/install-and-setup/installation) page to find the right package for your OS. | ||
|
|
||
| Next, install `cloudflared`. | ||
|
|
||
| ### .deb install | ||
| Use the deb package manager to install `cloudflared` on compatible machines. `amd64 / x86-64` is used in this example. | ||
|
|
||
| ```sh | ||
| wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb dpkg -i cloudflared-linux-amd64.deb | ||
| ``` | ||
|
|
||
| ### .rpm install | ||
| Use the rpm package manager to install `cloudflared` on compatible machines. `amd64 / x86-64` is used in this example. | ||
|
|
||
| ```sh | ||
| wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm | ||
| ``` | ||
|
|
||
| ### Build from source | ||
|
|
||
| You can also build the latest version of `cloudflared` from source with the following steps. | ||
|
|
||
| ```sh | ||
| $ git clone https://github.com/cloudflare/cloudflared.git | ||
| $ cd cloudflared | ||
| $ make cloudflared | ||
| $ go install github.com/cloudflare/cloudflared/cmd/cloudflared | ||
| ``` | ||
|
|
||
| Depending on where you installed `cloudflared`, you can move it to a known path as well. | ||
|
|
||
| ```bash | ||
| mv /root/cloudflared/cloudflared /usr/bin/cloudflared | ||
| ``` | ||
|
|
||
| </div> | ||
| </details> | ||
|
|
||
| ## 2. Authenticate `cloudflared` | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel login | ||
| ``` | ||
|
|
||
| Running this command will: | ||
|
|
||
| * Open a browser window and prompt you to log into your Cloudflare account. After logging into your account, select your hostname. | ||
| * Generate a [cert.pem file](/connections/connect-apps/tunnel-useful-terms#cert-pem). The `cert.pem` file contains account-wide credentials. | ||
|
|
||
| ## 3. Create a tunnel and give it a name | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel create <NAME> | ||
| ``` | ||
|
|
||
| Running this command will: | ||
| * Create a tunnel by establishing a persistent relationship between the [name you provide](/connections/connect-apps/tunnel-useful-terms#tunnel-name) and a [UUID](/connections/connect-apps/tunnel-useful-terms#tunnel-uuid) for your tunnel. At this point, no connection is active within the tunnel yet. | ||
| * Generate a [credentials file](/connections/connect-apps/tunnel-useful-terms#credentials-file). | ||
| * Create a subdomain of `.cfargotunnel.com`. | ||
|
|
||
| From the output of the command, take note of the tunnel’s UUID and the path to your tunnel’s credentials file. | ||
|
|
||
| ## 4. Create a configuration file | ||
|
|
||
| Create a [configuration file](/connections/connect-apps/tunnel-useful-terms#configuration-file) in your `.cloudflared` directory using any text editor. This file will configure the tunnel to route traffic from a given origin to the hostname of your choice. | ||
|
|
||
| Add the following fields to the file: | ||
|
|
||
| **If you’re connecting an application** | ||
|
|
||
| ```txt | ||
| url: http://localhost:8000 | ||
| tunnel: <Tunnel-UUID> | ||
| credentials-file: /root/.cloudflared/6ff42ae2-765d-4adf-8112-31c55c1551ef.json | ||
| ``` | ||
|
|
||
| **If you’re connecting a network** | ||
|
|
||
| ```txt | ||
| tunnel: <Tunnel-UUID> | ||
| credentials-file: /root/.cloudflared/6ff42ae2-765d-4adf-8112-31c55c1551ef.json | ||
| ``` | ||
|
|
||
| ## 5. Start routing traffic | ||
|
|
||
| Now assign a CNAME record that points traffic to your tunnel subdomain. This record will be easier to remember and share. | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel route dns <UUID or NAME> <hostname> | ||
| ``` | ||
|
|
||
| You can confirm that the route has been successfully established by running: | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel route ip show | ||
| ``` | ||
|
|
||
| ## 6. Run the tunnel | ||
|
|
||
| Run the tunnel to proxy incoming traffic from the Tunnel to any number of services running locally on your origin. | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel --config path/config.yaml run <UUID or NAME> | ||
| ``` | ||
|
|
||
| You can also run the tunnel without a configuration file. To do that, run it by adding the necessary [flags](/connections/connect-apps/configuration/config#arguments) after the `run` command and before the name or UUID. For example, running your tunnel with this command way will route all traffic to the given URL: | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel run --url localhost:3000 <NAME or UUID> | ||
| ``` | ||
|
|
||
| Cloudflare Tunnel can install itself as a system service on Linux and Windows and as a launch agent on macOS. For more information, refer to [Run as a service](/connections/connect-apps/run-tunnel/run-as-service). | ||
|
|
||
| ## 7. Check the tunnel | ||
|
|
||
| Your tunnel configuration is complete! Navigate to **Access** > **Tunnels** on the Teams Dashboard to see your tunnel listed as active. If you want to see a list of active tunnels directly from your CLI, you can run: | ||
|
|
||
| ```bash | ||
| $ cloudflared tunnel list | ||
| ``` |
30 changes: 30 additions & 0 deletions
30
...ucts/cloudflare-one/src/content/connections/connect-apps/tunnel-useful-terms.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| order: 2 | ||
| pcx-content-type: reference | ||
| --- | ||
|
|
||
| # Useful terms | ||
|
|
||
| ## Tunnel | ||
| A tunnel is a secure, outbound-only pathway you can establish between your origin and the Cloudflare edge. Each tunnel you create will be assigned a [name](#tunnel-name) and a [UUID](#tunnel-uuid). | ||
|
|
||
| ## Tunnel UUID | ||
| A tunnel UUID is an alpha-numeric, unique ID assigned to a tunnel. The tunnel UUID can be used in [configuration files](#configuration-file), and in general, whenever you need to reference a specific tunnel. | ||
|
|
||
| ## Tunnel name | ||
| The `cloudflared tunnel create <NAME>` command creates a tunnel and assigns it a name. Once named, a tunnel is a persistent pathway within which you can stop and start as many [connectors](#connector) as needed, adding stability and ease of use to your tunnel experience. Tunnel names do not need to be hostnames; for example, you can assign your tunnel a name that represents your application/network, a particular server, or the cloud environment where it runs. A human-readable identifier lets you easily reference a tunnel whenever you need. | ||
|
|
||
| ## Connector | ||
| Users can create and configure a tunnel once and run it as multiple different `cloudflared` processes. These processes are known as connectors, or replicas. DNS records and Cloudflare Load Balancers can still point to the tunnel and its UUID, while that tunnel sends traffic to the multiple instances of cloudflared that run through it. Using multiple connectors provides tunnels with high availability, scalability, and elasticity. | ||
|
|
||
| ## Configuration file | ||
| This is a `.yaml` file that functions as the operating manual for `cloudflared`. By creating a configuration file, you can have fine-grained control over how their instance of cloudflared will operate. This includes operations like what you want `cloudflared` to do with traffic (for example, proxy websockets to port `xxxx`, or ssh to port `yyyy`), where `cloudflared` should search for authorization (credentials file, tunnel token), and what mode it should run in (for example, [`warp-routing`](/connections/connect-networks/private-net/create-tunnel#configure-the-tunnel)). In the absence of a configuration file, cloudflared will proxy outbound traffic through port `8080`. | ||
|
|
||
| ## Cert.pem | ||
| This is the certificate file issued by Cloudflare when you run `cloudflared tunnel login`. This file is required when you create new tunnels, delete existing tunnels, change DNS records, or configure tunnel routing from cloudflared. This file is not required to perform actions such as running an existing tunnel or managing tunnel routing from the Cloudflare dashboard. The cert.pem origin certificate is valid for at least 10 years, and the service token it contains is valid until revoked. | ||
|
|
||
| ## Credentials file | ||
| This file is created when you run `cloudflared tunnel create <NAME>`. It stores your tunnel’s credentials in a `.json` format, and is unique to each tunnel. This file functions as a token authenticating the tunnel it is associated with. | ||
|
|
||
| ## Ingress rule | ||
| Ingress rules let users specify which local services traffic should be proxied to. If a rule doesn't specify a path, all paths will be matched. Ingress rules can be listed in your [configuration file](#configuration-file) or when running `cloudflared tunnel ingress`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+190 KB
...re-one/src/content/static/secure-web-gateway/microsoft-mcas/mcas-block-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+326 KB
...flare-one/src/content/static/secure-web-gateway/microsoft-mcas/mcas-domains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...oudflare-one/src/content/static/secure-web-gateway/microsoft-mcas/mcas-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+242 KB
...dflare-one/src/content/static/secure-web-gateway/microsoft-mcas/mcas-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+419 KB
.../src/content/static/secure-web-gateway/secure-dns-network/gateway-analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abelinkinbio @sudarshan-reddy the idea is to make this a download page, and move everything re: installation to its own
Tunnel guide, one for each OS. wdyt?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea! I think this page is a bit cluttered and this will help. However, maybe we can do something like a modal for each OS only when the instructions diverge keeping the rest common? (For example, I love what Go does here: https://golang.org/doc/install)