mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
update notes and steps
This commit is contained in:
@@ -4,61 +4,70 @@
|
||||
A typical scenario administrators have is accessing their office networks remotely. With [Network routes](https://docs.netbird.io/how-to/routing-traffic-to-private-networks), NetBird makes this easy. Still, administrators often want to avoid routing their users’ traffic via NetBird when they are in the office. To solve this, administrators can leverage the power of [Posture Checks](https://docs.netbird.io/how-to/manage-posture-checks)and create policies that allow connection to the routing peers only if they are outside the office by using a [Peer Network Range](/how-to/manage-posture-checks#peer-network-range-check) posture check with a block action.
|
||||
|
||||
## Example
|
||||
In the following scenario, our office network is on the subnet `192.168.1.0/24`. Let's assume all users will be part of the group `route`users, and the routing peer for our office will be inside the group `route-nodes`. With this in mind, the goal is to create a Posture Check, create a Policy and assign a Posture Check to it, and finally create a Network Route that will expose the office subnet.
|
||||
In the following scenario, our office network is on the subnet `192.168.1.0/24`. Let's assume all users will be part of the group `route-users`, and the routing peer for our office will be inside the group `route-nodes`.
|
||||
With this in mind, the goal is to create a Posture Check, create a Policy and assign a Posture Check to it, and finally create a Network Route that will expose the office subnet.
|
||||
|
||||
### Create a Posture Check
|
||||
To create a Posture Check, navigate to the `Access Control -> Posture Checks` section in the NetBird dashboard and click on **Add Posture Check**.
|
||||
To create a Posture Check, navigate to the `Access Control -> Posture Checks` section in the NetBird dashboard and click on **Add Posture Check**.
|
||||
|
||||
Select `Peer Network Range` and then `Block`. Click `Add Network Range` and input your office subbnet `192.168.1.0/24`. Note that if you have multiple locations that you want to see excluded, you can add multiple network ranges.
|
||||
|
||||
Select `Peer Network Range` and then `Block`. Click `Add Network Range` and input your office subnet `192.168.1.0/24`. Note that if you have multiple locations that you want to see excluded, you can add multiple network ranges.
|
||||
Select `Peer Network Range`.
|
||||
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/posture-check-new-block-network-range.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
Select the `Block` action and click on `Add Network Range` to input your office subbnet `192.168.1.0/24`.
|
||||
<Note>
|
||||
Note that if you have multiple locations that you want to see excluded, you can add multiple network ranges.
|
||||
</Note>
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/posture-check-block-network-range.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
Click `Save`, then click `Continue` and fill out `Name of the Posture Check` with "Exclude Office subnet.”
|
||||
Click `Save`, then click `Continue` and fill out `Name of the Posture Check` with "Exclude Office subnet”.
|
||||
|
||||
After we conclude this step, we are ready to create a policy and assign this posture check.
|
||||
### Create a Policy
|
||||
We start by creating a simple policy that will allow access from group `route-users` to group `route-nodes`. Navigate to the `Access Control -> Policies` section in the NetBird dashboard and click on `Add Policy`.
|
||||
We start by creating a simple policy that will allow access from group `route-users` to group `route-nodes`.
|
||||
This is needed to establish the connection between the users and the routing peer.
|
||||
|
||||
On the `Source` field, select the group `route-user`, and on the `Destination` field, select the group `route-nodes`. Choose `UDP` for the protocol and type `1`on Ports. Click `Continue`.
|
||||
Navigate to the `Access Control -> Policies` section in the NetBird dashboard and click on `Add Policy`.
|
||||
|
||||
On the `Source` field, select the group `route-user`, and on the `Destination` field, select the group `route-nodes`.
|
||||
Choose `UDP` for the protocol and type `1`on Ports. Click `Continue`.
|
||||
<Note>
|
||||
Note that the protocol and port are arbitrary and can be changed according to your needs. An usual choice is to allow ICMP traffic for troubleshooting purposes.
|
||||
</Note>
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/policy-office-subnet-with-posturecheck.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
In this step, we'll click `Browse Checks` and select the posture check we created earlier, `Exclude Office subnet`. Click `Add Posture Checks(1)` and then click `Continue`.
|
||||
In this step, we'll click `Browse Checks` and select the posture check we created earlier, `Exclude Office subnet`. Click `Add Posture Checks(1)` and then click `Continue`.
|
||||
In this step, we'll click `Browse Checks` and select the posture check we created earlier, `Exclude Office subnet`.
|
||||
|
||||
Click `Add Posture Checks` and then click `Continue`.
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/policy-with-network-posturecheck-added.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
Give your policy the name "Allow users to route-nodes".
|
||||
Give your policy the name "Allow users to route-nodes" and click on `Add Policy`.
|
||||
|
||||
We are now ready for the final step of creating the office route.
|
||||
|
||||
### Create a Network Route
|
||||
|
||||
Now, let's create a [Network Route](https://docs.netbird.io/how-to/routing-traffic-to-private-networks) that will expose the local office subnet `192.168.1.0/24`, which will be distributed to all peers inside the group `route-users`. In this example we will be using a routing peer named `router-01` which will be part of the group `route-nodes`.
|
||||
Now, let's create a [Network Route](https://docs.netbird.io/how-to/routing-traffic-to-private-networks) that will expose the local office subnet `192.168.1.0/24`, which will be distributed to all peers inside the group `route-users`. In this example, we will be using a routing peer named `router-01`, which will be part of the group `route-nodes`.
|
||||
Now, let's create a [Network Route](https://docs.netbird.io/how-to/routing-traffic-to-private-networks) that will expose the local office subnet `192.168.1.0/24`,
|
||||
which will be distributed to all peers members of the group `route-users`. In this example, we will be using a routing peer named `router-01`,
|
||||
which is a member of the group `route-nodes`, this way, the policy we just created goes into effect, and all peers from the group `route-users` will be able to reach
|
||||
`router-01` only if they are not in the office network, due to our posture check.
|
||||
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/route-office-subnet-posturecheck.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
|
||||
In this example, our routing peer is called `router-01` and sits inside the `route-nodes` group, this way, the policy we just created goes into effect, and all peers inside `route-users` will be able to reach `router-01` only if they are not in the office network, due to our posture check.
|
||||
Navigate to `Network Routes` menu on the NetBird dashboard and click on **Add Route**. Fill out the fields as shown in the image below, and click `Save`.
|
||||
|
||||
In this example, our routing peer is called `router-01` and it's placed inside the `route-nodes` group, this way, the policy we just created goes into effect, and all peers insidez `route-users` will be able to reach `router-01` only if they are not in the office network, due to our posture check. Navigate to the `Network Routes` menu on the NetBird dashboard and click on `Add Route`. Fill out the fields as shown in the image below, and click `Save`.
|
||||
To get started navigate to `Network Routes` menu on the NetBird dashboard and click on **Add Route**. Fill out the fields as shown in the image below, and click `Continue`:
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/create-route-with-posturecheck.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
Click `Continue` and assign `route-users` do `Distribution Groups`.
|
||||
Next assign `route-users` do `Distribution Groups`.
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/distribute-to-groups-posturechecks.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
Click `Continue` and assign the name "Office network access" to `Network Identifier`, click `Continue` agaom and in the final step, finish this process by clicking `Add Route`.
|
||||
|
||||
<p>
|
||||
<img src="/docs-static/img/how-to-guides/route-office-subnet-posturecheck.png" alt="high-level-dia" className="imagewrapper"/>
|
||||
</p>
|
||||
### Testing Posture Check
|
||||
Now that we have created the Posture Check, the Policy, and the Network Route, we can test this configuration. In the following example, we will be testing this Posture Check from a macOS client named `client-01`, and as stated earlier, it belongs to the group `route-users`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user