Route Hub and Spoke VCN with pfSense Firewall in the Hub VCN

From Iwan
Jump to: navigation, search

Hub and spoke routing within a cloud provider can be confusing and hard to configure. To achieve this we need to configure multiple objects with different types of configuration. Network routing and network security across multiple levels inside the cloud make this confusing.

In this tutorial, we will explain how to configure a hub VCN with three-spoke VCNs. The hub VCN will contain the pfSense firewall and the connection to the internet and OCI services network. All network traffic originating from the spoke VCN that needs to communicate with other spoke VCNs or with the Internet or the OCI services network needs to pass the hub VCN for firewall inspection.

Profile-hub-spoke-vcn.jpg

The following images illustrate the traffic flows.

- Spoke to spoke connectivity

9042c277456af862b22bd979abfa0dad.png

- Spoke to Hub connectivity

A44add88eebd67eee8f5db5bcdb88820.png

- Hub to Spoke connectivity

035795ba5a58d08c93570a93bf006f32.png

- Spoke to Internet connectivity

4ae22781d21c126a7e8b2b685f01eb4c.png

- Spoke to Service connectivity

6aaabd390f6f7b25811188e69a1977f2.png

- Hub to Internet connectivity

06ef2e7ee033879960f036b982ffe568.png

- Internet to Hub connectivity

4b184746df83b08f581dea1233039d7d.png


<aside> In this tutorial, we will use several networks in the spokes.

- Spoke A VCN subnet: `172.16.1.0/25`.
- Spoke B VCN subnet: `172.16.2.0/25`.
- Spoke C VCN subnet: `172.16.3.0/25`. </aside>


Objectives

- Set up an OCI routing environment with hub and spoke routing fully configured. We will route all network traffic to the hub VCN where the hub VCN will contain a firewall that will inspect all the traffic coming from the spokes.

- Task 1: Create the hub and spoke VCNs.
- Task 2: Create the subnets inside the hub and spoke VCNs.
- Task 3: Create a DRG, internet gateway, and a NAT gateway.
- Task 4: Add instances attached to different subnets inside all VCNs.
- Task 5: Add a pfSense firewall in the hub VCN.
- Task 6: Open firewall rules on the security lists.
- Task 7: Configure routing between the different VCNs and the internet with hub firewall inspection.
- Task 8: Verify the connectivity.

Task 1 - Create the Hub and Spoke VCNs

- Log in to the OCI Console and click Virtual cloud Networking or click the hamburger menu (≡), Networking and Virtual cloud networks.

45682715466ca32f5dc53f07af5a1ef9.png

- Click Create VCN to create the VCN.

2c22fbb82501ce49fce292fcbfe5ec45.png

1. Enter the Name for the hub VCN.
2. Enter an IPv4 CIDR Block for the hub VCN.
3. Scroll down.

Cb8a1712e70d36404c205cc13138b83a.png

- Click Create VCN.

D1ab516a601996033eb0cc398ea4aafd.png

1. Notice that the hub VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

B7117a124982eccf5f41bcada6795eb7.png

- The following image illustrates the visual representation of what you have created so far.

17ad73a49abb10c27740ec20032d4516.png

Now, we will create three spoke VCNs (Spoke A, Spoke B, and Spoke C).

- Click Create VCN to create the first spoke VCN (Spoke A).

6528172d1bc68cadb8de27b93ebcdd7a.png

1. Enter the Name for the spoke VCN.
2. Enter an IPv4 CIDR Block for the spoke VCN.
3. Click Create VCN.

71a39dd1d8cb2d633866b9504a636694.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

06e47c532ec0a843fa6587bf8541941b.png

- Click Create VCN to create the second spoke VCN (Spoke B).

70833b6ae8fc0d7dea53e8814295d128.png

1. Enter the Name for the spoke VCN.
2. Enter an IPv4 CIDR Block for the hub VCN.
3. Click Create VCN.

028a5d41bc89a4b7f8a4d0ed3939d70f.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

B2bf3eb4d5acca8dd5a54e12cd77ce16.png

1. Click Create VCN to create the third spoke VCN.
2. Enter the Name for the spoke VCN.
3. Enter an IPv4 CIDR Block for the hub VCN.
4. Click Create VCN.

Bdb44bf8dddb3589dd9abf70ddc4705c.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

826e1cc601516a481aa7fbc4dbae0612.png

- Notice that we have created 1 hub and 3 spoke VCNs.

B719de46166439d61134a5ce314c6508.png

- The following image illustrates the visual representation of what you have created so far.

5e08a741b54d75df80a919144ac4a7ee.png

Task 2 - Create the Subnets inside the Hub and Spoke VCNs

We have the hub and spoke VCNs in place. Now, create subnets inside the VCNs.

Create a Subnet inside Hub VCN

In the hub VCN we will create 1 private subnet and 1 public subnet.

- Click the hub VCN.

D6f125151e5ec54f7fc51cf4775b76bb.png

- Click Create Subnet to create the first subnet (private).

B1825be4d4116f6f9b1db681082b3107.png

1. Enter the Name for the private subnet.
2. In Subnet Type, select Regional.
3. Enter IPv4 CIDR Block for the private subnet.
4. Scroll down.

D84ed53f2407bb7ba568e582e73af5ad.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

3647681139cb3db731ca63225d589285.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

E725e49b0c9cd0b135d7378bdfc64b2e.png

- Notice that the state is set to Provisioning.

331595efbcf4e4f5faff707ff41e52cf.png

1. After a few minutes the state is changed to Available.
2. Click Create Subnet to create the second subnet (public).

12d1e7de41cbdea95096efd03f0ec8b2.png

1. Enter the Name for the private subnet.
2. In Subnet Type, select Regional.
3. Enter IPv4 CIDR Block for the public subnet.
4. Scroll down.

49df7be085a8c305c4c0ef9368e98fed.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Public Subnet.
3. Scroll down.

224f7a163d3f66a320d65d7cab734709.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

A03c5b2338d0301b1b43524775d942b0.png

- Notice that the state is set to Provisioning.

28e266ff9927c5c6664bf22aa0240214.png

- After a few minutes the state is changed to Available.

2d4f7dc81c6d51633258dcda6febd35c.png

- The following image illustrates the visual representation of what you have created so far.

C632adfde5636a5400666d784ac3a635.png

Create a Subnet in Spoke VCN A

Create one private subnet inside the spoke VCN A.

- Click the spoke VCN A.

5a5d18a1211b733b82a96bce878b9b83.png

- Click Create Subnet to create the subnet (private).

Ff12e2c2970f7b7c843657e688266d82.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

1642f9c3c967f77af1faf23e43a3e5b1.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

Ed3bae9e775db00dc35d640a79a0f38a.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

D9a193a370bf94c37ca7f58460c811de.png

- Notice that the state is set to Provisioning.

7adf58d425b4221dad26753f4ac3bfe5.png

1. Notice that the state is changed to Available.
2. Click Virtual Cloud Networks to return to the VCN page.

5e9cbe24446d97300752eb5fb1d4e498.png

- The following image illustrates the visual representation of what you have created so far.

8362f3383f70c00d17d84235a4f60006.png

Create a Subnet in Spoke VCN B

Create one private subnet inside the spoke VCN B.

- Click the spoke VCN B.

49082b6c935ce756a20971326a6f5cc8.png

- Click Create Subnet to create the subnet (private).

F320fb3bd2139aaa37198a7b9d3d9f87.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

9391bc60391c148bc4b56660bfe96f33.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

5e3bd705930cd14671288829f6e610d9.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

Db66b56a8cc880ba914198ad4206bd0f.png

- Notice that the state is set to Provisioning.

Dbb0c8fb621bbe1b6644fd27716a6a10.png

1. Notice that the state is changed to Available.
2. Click Virtual Cloud Networks to return to the VCN page.

57022af393cb8b9466b1d53c70ff3f2c.png

- The following image illustrates the visual representation of what you have created so far.

60071e76eddc1669d6d337ea25e6fea0.png

Create Subnet inside Hub VCN C

Create one private subnet inside the spoke VCN C.

- Click the spoke VCN C.

Eb39479ef5119821664f260a2d62dddd.png

- Click Create Subnet to create the subnet (private).

Bcca55427e9c61ca7902b946ff5c45ff.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

A7bfa47e7f2b4d17eed75bc9073d0a72.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

D18c5d60c2847a8e4447ee0422b6c0af.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

496a7c72fbf6d93f0902d3db2d3967a3.png

- Notice that the state is set to Provisioning.

9261122712598297660ba0e6fc381070.png

- Notice that the state is changed to Available.

B7d1bf9661877fcae257c399d51e0502.png

- The following image illustrates the visual representation of what you have created so far.

0d32a3dfea2a02bd43d140438e7b0797.png

Task 3 - Create a Dynamic Routing Gateway -DRG- and Internet Gateway and a NAT Gateway in the Hub VCN

Create a DRG that will be used to route traffic between the VCNs. We also need to create an internet gateway and a NAT gateway for our access to the Internet.

- Click the hub VCN.

D6f125151e5ec54f7fc51cf4775b76bb.png

- Click Internet Gateways.

59f24061b1a5ed8c71c107734d5bf171.png

1. Click Create Internet Gateway.
2. Enter the Name of the internet gateway.
3. Click Create Internet Gateway.

41afee9a40e292e5d2fcdfb5f72fc029.png

1. Notice that the state is Available.

85c11bdd27f0b4ef0d3890de7a346c6d.png

- The following image illustrates the visual representation of what you have created so far.

15f1ad8b624453a781b30b60d66e6bed.png

1. We are inside the hub VCN configuration page after internet gateway creation. Scroll down.
2. Click NAT Gateways.
3. Click Create NAT Gateway.

08e4e119533787fd4947934ea9e6ad9e.png

1. Enter the Name of the NAT Gateway.
2. Select Ephemeral Public IP Address.
3. Click Create NAT Gateway.

0984c7cf913202138e7f27abf62f645c.png

1. Notice that the state is Available.

Cb26f7efcc7cf2ff6d95ed5f22a4820f.png

- The following image illustrates the visual representation of what you have created so far.

356ffbde99f230a5f1a9b499b5b035bb.png

- Create the Dynamic Routing Gateway (DRG).

1. Click the hamburger menu (≡) icon from the upper left corner.
2. Click Networking.
3. Click Dynamic routing gateway.

4da099a2902c4e56d6228bf0a00c910e.png

- Click Create dynamic routing gateway.

54ff39ed8d970dd6924f493192206d3c.png

1. Enter the Name of the dynamic routing gateway.
2. Click Create dynamic routing gateway.

E3cd9c63511e57953267046f0e8308f2.png

1. Notice that the state is PROVISIONING.

Baf03a18c5cd89e8180ab2da12b2a5a5.png

- Notice that the state is changed to AVAILABLE.

60a96886b67c83d0300c28d7ae54809b.png

- The following image illustrates the visual representation of what you have created so far.

E9e1c4c292397ab31e12deb2a860c96f.png

Task 4 - Add Instances attached to different Subnets inside all VCNs

We will add various OCI Compute instances in all the VCNs so we can test out the routing flows.

Create Instance in Hub VCN

In the hub VCN, we will create a Windows compute instance that will have two main functions:

- The Windows instance will act as a stepstone machine to access the other instances inside our OCI environment.

- The Windows instance will also be a network endpoint that can be used for testing the routing flows.

Windows Instance as Step Stone

To create a Windows instance (hub-step-stone) that can act as a stepping stone inside your OCI environment, use [Deploy a Windows Instance in Oracle Cloud Infrastructure.]

Note

Create the Windows stepping stone instance (hub-step-stone) before you continue with the tutorial.

The following image illustrates the visual representation of what you have created so far.

128a1032b9fe8b9511bf0402531134fd.png

Create Instance in Hub VCN Spoke VCN A

In the spoke VCN A, we will create a simple Linux instance that will act as a network endpoint that we can use to test our routing flows.

Spoke A Client Instance

- Create a instance.

1. Click the hamburger menu (≡) icon from the upper left corner.
2. Click Compute.
3. Click Instances.

75af10535557180792647d213c103b36.png

- Click Create Instance.

Cf8ccd28d528ec4a347aebbb17833de4.png

1. Enter the Name of the instance.
2. Scroll down.

Db9c01fb0261c94365fc38a66984f70e.png

- Scroll down.

99b017b659f3814b1b345b834de80750.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-A.
3. In Subnet, select Select existing subnet.
4. Select Private Subnet from the spoke VCN A.
5. Scroll down.

8b425dda55669021b976cf489b69721c.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

F78baafb934ef8db65ce16b9ddd708dd.png

1. In Add SSH keys, select Generate a key pair for me.
2. Click Save private key to save the private key locally.
3. Click Save public key to save the public key locally.

C48c2b6ec9f01ed1a35ff348c6256355.png

- Make sure the keys are stored somewhere locally.

Note

We will use the same key pair for the other spoke instances.

52c14226785e21f75120b6642cb426d3.png

- Scroll down.

4608959072223e1e9d8b08cef2010b59.png

- Click Create.

E6023a9f239cc00735364b2926d39fab.png

- Notice that the state is PROVISIONING.

Fb8677264c5bc130a7262c3beabe1fdc.png

1. Notice that the state is changed to RUNNING.
2. Note the Private IP address for later.
3. Click Instances to return to the instances page.

Eff27ab9c44d3dfca08bf65b2ee6eeb4.png

1. Notice that the Instance A is running.
2. Click Create Instance to create the next instance.

532a1d64e64ed411518207ad04781c85.png

- The following image illustrates the visual representation of what you have created so far.

94eba5c7fa41ed0fd25c7618a2003483.png

Create Instance in Spoke VCN B

In the Spoke VCN B, we will create a simple Linux Instance that will act as a network endpoint that we can use to test our routing flows.

Spoke B Client Instance

- Create an instance.

1. Enter the Name of the instance.
2. Scroll down.

13b8a132f1cf1289208a9ba316395f26.png

- Scroll down.

6c6379628e2504dc17fe9f8a5af123e0.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-B.
3. In Subnet, select Select existing subnet.
4. Select the Private Subnet from spoke VCN B.
5. Scroll down.

786d2cf77740ad2c0094305ff28b444e.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

3b459af2a2ad100b488ab14684e60807.png

1. Upload public key files.
2. Click Browse. Select the public key file you saved when you created instance A.
3. Make sure the public key is selected.
4. Scroll down.

7261c3fa95b0fbbb9134300b1bbb431d.png

- Scroll down.

E9b9d9274735fa2eaef987eeceb71c35.png

- Click Create.

6cbfddb23735cde1ed16a70074e3746c.png

- Note that the state is PROVISIONING.

Af4a133daac894198701b4cc02daa95f.png

1. Note that the state is changed RUNNING.
2. Note the Private IP address to be used in a later step.
3. Click Instances to return to the instances page.

9da61504451fbde20ffd5e7d500c84ea.png

1. Note that Instance B is Running.
2. Click Create Instance to create the next instance.

4f130afc8f86ef7d68fb50050559d627.png

- The following image illustrates the visual representation of what you have created so far.

38ec499ffd092f2759835bd35869f66b.png

Create Instance in Spoke VCN C

In the Spoke VCN C, we will create a simple Linux instance that will act as a network endpoint that we can use to test our routing flows.

Spoke C Client Instance

- Create an instance.

1. Enter a name of the instance.
2. Scroll down.

D89810970bd5a662b568dcdd6789e9ff.png

- Scroll down.

6f559a7a29d450f6fbd3d6881ee8e724.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-C.
3. In Subnet, select Select existing subnet.
4. Select the Private Subnet from the spoke VCN C.
5. Scroll down.

3a5a30798450d5c21e71b5d4a3f531fc.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

07826edd5e7cb76cec679790f2e5a2c9.png

1. Upload public key files.
2. Click Browse. Select the public key file you saved when you created instance A.
3. Make sure the public key is selected 4. Scroll down.

B9c5b3c7b219616935907034e5402547.png

- Scroll down.

E6b8eb433b2b4c6bb7df8fd3e2eac380.png

- Click Create.

6e65fd19cb8c07071055d83cb56a7142.png

- Notice that the state is PROVISIONING.

Acfc4695fff87777f12faff9671b88a6.png

1. Notice that the state is changed to RUNNING.
2. Note the Private IP address for later.
3. Click Instances to return to the instances page

8aab6f0a9ba85a4b633e43c5e0a1ff19.png

- Notice that the Instance C is running.

6f05e20c085fc6b278ef7c89ed70d25d.png

- The following image illustrates the visual representation of what you have created so far.

687e141ff94d071f637a9d829d6106c7.png

Task 5 - Add a pfSense Firewall Instance in the Hub VCN

The last instance we need for our network setup is a firewall. For example, this can be any firewall like the OCI Network Firewall. In this tutorial, we will use the pfSense firewall.

To create a pfSense instance (`hub-fw`) which can act as a firewall inside your OCI environment, use [this tutorial.]

Note

Create the pfSense instance before you continue the tutorial.

The following image illustrates the visual representation of what you have created so far.

E787ca1d73f90ee3d6cf79f2309a1d49.png

Task 6 - Open Firewall Rules on the Security Lists

In an OCI environment, there are multiple layers of network security. By default, all ingress network traffic is blocked for most protocols and ports. To make testing with ping possible we will open the ICMP ports on the hub and spoke VCNs so that we can allow all ICMP traffic that is coming into the VCN.

Add Ingress Rule in Hub VCN

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Virtual Cloud Networks or navigate to Networking and Virtual Cloud Networks.

Bfbf9ebc41a70f2ae52213091e40cb3d.png

- Select the hub VCN to which your pfSense firewall is attached.

D6315b3654dd2b6dbe4e136691ccac21.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for HUB-VCN.

9544779687129ea524ed4d85320c4b81.png

- Click Add Ingress Rules.

A4c088f501942467d43f57a1f19fbddf.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

781040ff9b9bec94580b5eb148351bbc.png

- Note the ICMP rules is added.

Cc6c159a12691eb43f9a3ac3709792ac.png

- Click Virtual cloud networks to return to the VCN page.

5940eda4f57cb06c15fe5da5fc592a9a.png

- The following image illustrates the visual representation of what you have created so far.

6111813a9a5abc601564ba6cc3bd5965.png

Add Ingress Rule in Spoke VCN A

- Click the spoke VCN A.

Dcd18615fd8b03cae55e11e5051a91b4.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-A

A205d822e9c68c5b0ed3d943a7a1b363.png

- Click Add Ingress Rules.

3f111c50bfaf6f0653c6a0d1abc56f9a.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

C8833776945f089d0c147b086e0dc032.png

- Notice the ICMP rule is added.

D1d1eb004dc84bb5fd61b14b145ad6e3.png

- The following image illustrates the visual representation of what you have created so far.

05a5da2c5788173cb6bb1244606d0375.png

Add Ingress Rules in Spoke VCN B

- Click the spoke VCN B.

A0cafdfc2beb319e482ae1e2bf6e7499.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-B

9ab7df73f9851bb8d8943372a2089ab2.png

- Click Add Ingress Rules.

8c745ab425d3bd63abcba555b67e3743.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

44fd6bbcbda4cb3442429ea8f2b88f8d.png

- Note the ICMP rule is added.

8e5871cddcb9ab353368085d6ba8f8a8.png

- The following image illustrates the visual representation of what you have created so far.

09990a8b6f84f968c800222588e7fb6e.png

Add Ingress Rules in Spoke VCN C

- Click spoke VCN C.

9e6582ffa04eee40d61491d09dbd8ce0.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-C

B77e591bc90223ac8d927280fb1df173.png

- Click Add Ingress Rules.

8ed522bc8a698e70b772ae8c6321c027.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

120d027cc4ccac10cf7c07b71ab09c10.png

- Note the ICMP rule is added.

Fdbb69d6d43af43b149f7f778300b48e.png

- The following image illustrates the visual representation of what you have created so far.

65a6625e95dcd0416a592593b91ebd38.png

Task 7 - Configure Routing between the different VCNs and the Internet with Hub Firewall Inspection

We already have all the required components. Now, we need to configure routing. Before we can configure routing we need to first attach the VCNs to the DRG.

After this, we will create the attachments that we need to create different VCN routing tables, DRG routing tables and to associate these routing tables to different VCNs, DRG VCN attachments, subnets, and gateways.

Task 7-1 - Create VCN Attachments on DRG

- Create VCN attachments on the DRG.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Dynamic Routing Gateway.

4d867d87b819856daed60615b77f702c.png

- Click the DRG created in Task 3.

Cb99517258e3371198a09798210fc1b3.png

1. Click VCN attachments.
2. Click Create virtual network attachment.

8dbaa1328444f4f70579ef694df7901d.png

1. Enter a Attachment name for the hub VCN.
2. Select the hub VCN.
3. Click Create VCN attachment.

757625231f469080232a5535b807bd50.png

- Notice that the hub VCN state is Attaching.

1e4a31a12516f675c8ea4f3092645c10.png

- The following image illustrates the visual representation of what you have created so far.

9c39bad8084c7b82bc9770896074936f.png

1. Notice that the hub VCN state changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

615b7e689c03f65f5d474d051eb02f55.png

1. Enter Attachment name for the spoke VCN A.
2. Select the spoke VCN A.
3. Click Create VCN attachment.

B191d90fa35dba807f01ad170f37e2ad.png

- Note that the spoke VCN A state is Attaching.

D9c3b488f8dd852ea752d12e8c5c9fbb.png

- The following image illustrates the visual representation of what you have created so far.

3c7dcefc1786c42515f7fa4018a85291.png

1. Note that the spoke VCN A state has changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

9dec2338605851624f140f6d85b17f0b.png

1. Enter Attachment name for the spoke VCN B.
2. Select the spoke VCN B.
3. Click Create VCN attachment.

Ee97e4d98b2e60488408ee9dfe3cdbd0.png

- Note that the spoke VCN B state is Attaching.

0b556d2cf97d5f9c35dfa8cc264b61b3.png

- The following image illustrates the visual representation of what you have created so far.

90f7d1b60e98489fcce84e031b190867.png

1. Note that the spoke VCN B state has changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

7e201f62e114c63477c17bd3eab3b184.png

1. Enter a Attachment name for spoke VCN C.
2. Select spoke VCN C.
3. Click Create VCN attachment.

0cfd6ab0ed3d868fd3cad465fbc63c07.png

- Note that the spoke VCN C state is Attaching.

0ab9551cdc24fca529ecb8e66a645119.png

- Note that the spoke VCN C state has changed to Attached.

4beaf8bf96fc068ff72cd6a611795e7b.png

- The following image illustrates the visual representation of what you have created so far.

9b2a6803d6e150992f75736b2feca7ee.png

Task 7-2 - Create and Configure Spoke VCN Routing Tables

We need to create two types of routing tables: VCN Routing Tables and DRG Routing Tables.

Note

By default when you create a VCN, a default routing table is created.

- Spoke VCN A only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

4c46d77b468378eee19d957aa0b85017.png

- Click spoke VCN A.

E201582495789cffa589aab9816966d2.png

1. Click Route Tables.
2. Click Default route table for SPOKE-VCN-A.

Aca368d38777093c627fc871541f8858.png

- Click Add Route Rules.

Ebc349d6c21766b0022ee850d08df9ce.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN A to the DRG.

F0f528bd3ebcb4c0db20aac73c2a6a7d.png

1. Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN A.
2. Click Virtual cloud networks to return to the VCN page.

64b2712c2c7e2aa50a1e6a6b15206c7f.png

- The following image illustrates the visual representation of what you have created so far.

76dc100fa42dc549165ab3ad83518f75.png

- Spoke VCN B only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

- Click spoke VCN B.

A81cfff309cb4c0b7ffc13ef3c35eda1.png

1. Click Route Tables.
2. Click Default Route Table from SPOKE-VCN-B.

9df1aaf8b80cea4098a533ea480b1b9a.png

- Click Add Route Rules.

E0a9992006018bb27a279d4366f8bad0.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN B to the DRG.

Eb02ade02d36f4efd4b863cad6fbc870.png

1. Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN B.
2. Click Virtual cloud networks to return to the VCN page.

0e8385516d797d32704990f7f74b13bf.png

- The following image illustrates the visual representation of what you have created so far.

Befce1297858072ad3f62fbe587e3c45.png

- Spoke VCN C only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

- Click spoke VCN C.

41f99ed388234a45915b740d1eb57dc7.png

1. Click Route Tables.
2. Click Default Route Table for SPOKE-VCN-C.

Fa581b11b3a73f6f5800e7892984f934.png

- Click Add Route Rules.

08d058adb9fa26707e88c75b1aafe629.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN C to the DRG.

5568679ad0b0f25cb9b2c617c09990cb.png

- Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN C.

69b83ca03b9f53d836a060ffc52f9913.png

- The following image illustrates the visual representation of what you have created so far.

4eb98fcd3d5e9bdc79b8d9433765e2b1.png

Task 7-3 - Create and Configure Hub VCN Routing Tables

- Create a route table (`VCN_HUB_RT_DRG_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 Private IP 172.16.0.20 (FW IP) Static
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static

{{note|To route the traffic that is going from spoke to spoke VCN's we also need to add in the specific routes in this route table as the default `0.0.0.0/0` is not enough to make this work.}

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

26a1ac3da51de3612f4e0bf4d667c27b.png

- Click the hub VCN.

2623d4766b66ce9095b13c24fb7415de.png

1. Click Route Tables.
2. Click Create Route Table.

23e383fde8f4dc7b7c120f8495b1660c.png

1. Enter the Name of the new hub VCN route table.
2. Click + Another Route Rule (not in the screenshot).
3. In Target Type, select Private IP.
4. Scroll down.

Abad73f35190c9d894a9ab0cf0e32cd2.png

1. In Destination Type, select CIDR Block.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
4. Click Create.

43aa5f4d1fbc40272a288e0f2cf1f209.png

1. Note that you will get the following error: `PrivatelP (ocid 1.privateip.oc1.eu-frankfurt-1.abtheljtrcahk23t4vtbeguxxxxxxxxxxxxxxxxxvwbgypf36ad4cyjmka) is an invalid route target. (The Private IP is attached to a VNIC whose SRC/DST check is enabled)`.

2. Click Cancel.

139e68c6a288353bac05fe5d9c765b62.png

- To fix this, we need to enable the skip source/destination check on the pfSense firewall instance VNIC.

1. Click the hamburger menu (≡).
2. Click Compute.
3. Click Instances.

967fec9a4252d1b6b10fc1f5831a1b15.png

- Click the `hub-fw` (pfSense instance).

8c227e63780db6bb655cc3975e01ec02.png

- Scroll down.

825bde99220cbdf7d9916e80a7e74c9b.png

1. Click Attached VNICs.
2. Click the three dots of the VNIC.
3. Click Edit VNIC.

733b2d5ee226a34399d59579720301f3.png

1. Select Skip source/destination check.
2. Click Save changes.

D503a89b324cfd00bd1732959cd4d2aa.png

- Now, create the hub VNC routing tables.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

F6524cc5d46d3a70d651741aadfde06c.png

- Click the hub VCN.

74806a4e6aea8684c71e5edbb7eb4163.png

1. Click Route Tables.
2. Click Create Route Table.

D4259b610f864ce94659d30c90ee45a4.png

1. Enter the Name for the new hub VCN route table.
2. Click + Another Route Rule.

7675a77b5bd7d3bf485e75312c705440.png

1. InTarget Type, select Private IP.
2. Scroll down.

1dcd279170fb749736c8e8b99ebe9a0c.png

1. In Destination Type, select CIDR Block.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
4. Click Create.

9c532adb8d6278f5f65a1826f33d59ac.png

- We need to add three more routes to the `VCN_HUB_RT_DRG_TRANSIT` route table.

- Click Add Route Rules.

9c7ccb4d400833ee1f174fa3d123864a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

Bd74d0390983c77d0fc725700ff9b07a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

908859432bba07b5cb7ebf2f6418a3ef.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

B9ee7cd41cf127ca26fa3502390ff956.png

1. Note that the 4 route rules created.
2. Click the Hub VCN to return to the Hub VCN page.

Ea8bf47d0faa7b5e06488f4b9f90d527.png

1. Note that the hub VCN routing table is now in the list.
2. Click Create Route Table again to create another hub VCN route table for the public subnet.

C825241d039d1f2d6c9a643531da05bb.png

- The following image illustrates the visual representation of what you have created so far.

7538f47aaa1ee85b3b4bfad14654cb2e.png

- Create a route table (`VCN_RT_HUB_PUBLIC_SUBNET`) in the hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 Internet Gateway hub-internet-gateway Static
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static

- Create route table.

1. Enter the Name for the new hub VCN route table for the public subnet.
2. Click + Another Route Rule.

D0c1f4d0b628b3a10baef485170f8271.png

1. In Target Type, select Internet Gateway.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. Scroll down.

Fedca2d366a46d24a06aca4278618d8b.png

1. In Target Internet Gateway, select the internet gateway you created earlier.
2. Click + Another Route Rule.

A59f0ada42355a9909ba4840d9305a69.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

7436dd89abcc46b14f30f067b3308661.png

- Click + Another Route Rule.

3061d7a223656ea905cb666eae976cb3.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

C363451b02971397b196006013740a64.png

- Click + Another Route Rule.

Ed5e91df2385274526e454d7fee0899e.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

C2f540a6dd6ea6d98324009e598871a9.png

1. Note that the route table for the public subnet is created. Click the routing table name.
2. Also, note that this routing table contains 4 routing rules.

56f8512ff6afee56345aa5b624aded4c.png

- Note if the 4 route rules are present.

92a3d2df89fdd94f04ed27a290ead991.png

1. Scroll up.
2. Click the Hub VCN to return to the Hub VCN page.

4fc93e7f7c28d17aa79ba07ce4a80228.png

- The following image illustrates the visual representation of what you have created so far.

0c9053f6cbffce926dce08eca972e7a2.png

- Create a route table (`VCN_HUB_RT_NAT_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static

1. Click Route Tables.
2. Click Create Route Table again to create another hub VCN route table for the NAT gateway.

Aa6c3c38e8fe825071d66dfaa222a095.png

1. Enter the Name for the new hub VCN route table for the NAT gateway.
2. Click + Another Route Rule.

9eb32ec75cb6552221d8e606715555c1.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

Bdab8cf97497ff287edefd53c7bf8a11.png

- Click + Another Route Rule.

4b0358c48ea54d2d38bd96c8bf64b74a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

C2ba20cab89ed41a1c5500dc8e40c072.png

- Click + Another Route Rule.

50f907c0fca100959a8cb843b5954e9f.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

43e0740d175766d7f21ca061ee31e1da.png

1. Note that the route table for the NAT gateway is created. Click the routing table name.
2. Also, note that this routing table contains 3 routing rules.

473e47680f31aa458f69bcd40d44436a.png

1. Note the 3 route rules we created.
2. Click Hub VCN to return to the Hub VCN page.

B8bbc3e521c919887fa1e531f9736a39.png

- The following image illustrates the visual representation of what you have created so far.

492aab841cbc96726a498a5f7e703c4f.png

- Create a route table (`VCN_RT_HUB_PRIVATE_SUBNET`) in the Hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 NAT Gateway hub-nat-gw Static
172.16.1.0/24 Dynamic Route Gateway DRG Static
172.16.2.0/24 Dynamic Route Gateway DRG Static
172.16.3.0/24 Dynamic Route Gateway DRG Static

1. Click Route Tables.
2. Click the routing table for the private subnet. If you do not have this table, then create it. To create the route table, click Create Route Table.

2e3542875da0763a63a0b1f9f0dbba28.png

1. Note that there is already one route rule present that will route all traffic (`0.0.0.0/0`) to the NAT gateway for the private subnet instances.
2. Click Add Route Rules.

26c48cc637d5dc3177363775de654837.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. Click + Another Route Rule.

D8410bbf108b6cc3d69233414590cbbd.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. Click + Another Route Rule.

60cfe96359682df13ffc40df6c06c748.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. Click Add Route Rules.

313d646f11d90ebf5e28992aca4c098c.png

- Note all the route rules for the private subnet routing table.

8198ea3d3f1a0711269e050e171f9646.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Task 7-4 - Create and Configure DRG Routing Tables

- Create a route distribution group (`DRG_RDG_IMPORT`) in the DRG.

Priority Match Type Match Criteria Action
1 Attachment SPOKE_VCN-A_ATTACHMENT ACCEPT
2 Attachment SPOKE_VCN-B_ATTACHMENT ACCEPT
3 Attachment SPOKE_VCN-C_ATTACHMENT ACCEPT

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Dynamic routing gateway.

D75a09fa9f7f3ff85b88f69de5746fd0.png

- Click the DRG created in Task 3.

66b4635cc31f32ac520a5b299783a11e.png

1. Click Import route distribution.
2. Click Create import route distribution.

8aa3785008c91e77095cca4cdc61accb.png

- In the Create import route distribution page, enter the following information.

1. Enter the Name for the route distribution.
2. Create a new route distribution statement.

   - Priority: Enter 1.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN A.
   - Action: Select Accept.


3. Create a new route distribution statement

   - Priority: Enter 2.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN B.
   - Action: Select Accept.


4. Create a new route distribution statement

   - Priority: Enter 3.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN C.
   - Action: Select Accept.


5. Click Create import route distribution.

20d66f4211e11fb3a4b5b689b9576604.png

- Click the new import route distribution.

892f940c7eba9ed0b1b3547eca4db1a7.png

1. Note the route distribution statements.
2. Click Dynamic routing gateways details to return to the DRG details page.

C4a2766fb2f1cebcf96889461a0915a5.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Create a route table (`DRG_RT_SPOKE_VCN_2`) in the DRG.

Destination CIDR Next Hop Attachment Type Next Hop Attachment Name
0.0.0.0/0 Virtual Cloud Network HUB_VCN_ATTACHMENT

1. Click DRG route tables.
2. Click Create DRG route table.

C77fea88e16a89d6beb7bafd5c0c254c.png

1. Enter the Name for the DRG route table.
2. Add a new static rule:

   - Destination CIDR Block: Enter `0.0.0.0/0`.
   - Next hop attachment type: Select Virtual Cloud Network
   - Next hop attachment: Select hub VCN.


3. Click Create DRG route table.

6a9ba8ea00f9ea01c08e5c5c826c5223.png

- Wait for the creation of the route table.

E8135524164341303553778da43ead5a.png

1. Note that the new DRG route table is created.
2. Click Create DRG route table to create another DRG routing table.

7c22001115333c5b2d3126859c04495a.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Create a route table (`DRG_RT_HUB_VCN_3`) in the DRG and import the route distribution group (`DRG_RDG_IMPORT`).

1. Enter the Name for the DRG route table.
2. Click Show Advanced options.

C977525ce905e58726e5c2ba76128c74.png

- Import the Import Route Distribution created earlier.

1. Click Route table settings.
2. Select Enable import route distribution.
3. Select the import route distribution created earlier.
4. Click Create DRG route table.

17722f474af2c4cba4fdf084972c17f5.png

1. Notice that the new DRG route table is created.

E211bb741686e51ae80b237bcd282a62.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Task 7-5 - Attach the Route Tables

Now that we have created route tables, we need to attach the route tables to the DRG, VCNs, subnets, and gateways.

Note

This is where routing is activated, so this is a careful process that needs to be thought of first and properly tested before you implement or make changes in a Production environment.

Attach the DRG Route Tables:

Let us first attach the DRG routing tables.

Attach DRG Routing Tables to the Spoke VCN Attachments

Routing Information: (`DRG_RT_SPOKE_VCN_2`) This DRG route table and route table attachment will make sure that all traffic that is coming from the spoke VCNs, is now routed to the hub VCN.

First, we are going to attach the ()`DRG_RT_SPOKE_VCN_2`) DRG Routing table to all the spoke VCN attachments.

- Go to the DRG page. Click Networking, Dynamic Routing Gateway and select the DRG created earlier.

1. Click VCN attachments.
2. Click the VCN attachment for Spoke A.

Dcb8fd665203d9d9ce26c1252883a08c.png

1. Note that the VCN attachment for Spoke A has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

B5d0d956a3a3dd12b6acb9aaa8e2ca19.png

- Click Show Advanced options.

961181374272d51fe6c04555fc8320ff.png

1. Select the DRG route table.
2. Select the DRG route table created earlier: `DRG_RT_SPOKE_VCN_2`.
3. Click Save Changes.

405618e474198b57089d711248dc6ab4.png

1. Note that a new DRG route table is active on the spoke A VCN attachment.
2. Click DRG to return to the DRG details page.

7429c1fca7e993786cbc00d4a03b776d.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Click the VCN attachment for spoke B.

C1bab2cc6b16107a44b6bae34774f6a7.png

1. Note that the VCN Attachment for spoke B has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

5cfaaf4ca15ef4c85ea22fca052b98d2.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_SPOKE_VCN_2`).
4. Click Save Changes.

00af855b3e994e2af8fae7864a2cdb6b.png

1. Note that a new DRG route table is active on the spoke B VCN attachment.
2. Click DRG to return to the DRG details page.

0c5da1731f23bf24bfbb7e3e033f7e21.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Click the VCN attachment for spoke C.

86bbef5f00ffe32640c175a97818c455.png

1. Note that the VCN attachment for spoke C has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

05ed5e25e45a3b1eaa456853f86a4ea1.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_SPOKE_VCN_2`).
4. Click Save Changes.

755d4892537d1aa2b8d9e3e40ad7440e.png

1. Note that a new DRG route table is active on the spoke VCN C attachment.
2. Click DRG to return to the DRG details page.

274f1200a29a52ce9bbc7413693dd0f1.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach DRG Routing Tables to the Hub VCN Attachment

We will attach the ()`DRG_RT_HUB_VCN_3`) DRG route table to the hub VCN attachment. We are also going to attach the (`VCN_HUB_RT_DRG_TRANSIT`) VCN route table to the hub VCN attachment.

Routing Information: (`DRG_RT_HUB_VCN_3`) This DRG route table and route table attachment will make sure that all networks from the spokes are known on the DRG and learned on the DRG so that the DRG knows what networks are available on the spokes and so it knows where to route the spoke networks to.

Routing Information: (`VCN_HUB_RT_DRG_TRANSIT`) This VCN route table and route table attachment will make sure that all traffic is routed to the firewall in the hub.

- Go to the DRG page. Click Networking, Dynamic Routing Gateway and select the DRG created earlier.

1. Click VCN attachments.
2. Click the VCN attachment for the hub.

62d0ea1c19018dd0df49eb02dcbf48a8.png

1. Note that the VCN attachment for the hub has the autogenerated DRG table associated. We need to change this.
2. Note that the VCN attachment for the hub has no VCN table associated. We need to add this.
3. Click Edit.

Ef6706269583637c42c67aff951a182e.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_HUB_VCN_3`).
4. Click the VCN route table tab.

4cd435fcce4165a763fc4008da412305.png

1. Select Select existing to select an existing VCN route table.
2. Select the VCN route table created earlier (`VCN_HUB_RT_DRG_TRANSIT`).
3. Click Save Changes.

5577fbfb63a1ce6175129fd5afdd3438.png

1. Note that a new DRG route table is active on the hub VCN attachment.
2. Note that a new VCN route table is active on the hub VCN attachment.

0b8fe36b50c1bc755fed5f62febbbc09.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach the VCN Route Tables:

Now, we are going to attach the VCN route tables even though we already started doing this for one of the VCN route tables in the previous task.

Attach VCN Routing Tables to the Hub VCN Public Subnet

Attach the (`VCN_RT_HUB_PUBLIC_SUBNET`) VCN route table to the the public subnet in the hub VCN.

Routing Information: (`VCN_RT_HUB_PUBLIC_SUBNET`) This VCN route table will route traffic that is destined for the spokes to the firewall. Traffic that is destined to the internet (all traffic other than spoke networks) to the internet gateway will also be routed by this route table.

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

Eb29eed5ef16e18e3ab4cebe0d58b3f0.png

- Click the hub VCN.

F6e514b14fcf2b94599719aefc65a978.png

1. Click Subnets.
2. Click Public hub Subnet.

Ba94762eeae2f503e1d18cca479c5cc1.png

1. Notice the public hub subnet has the default VCN table associated. We need to change this.
2. Click Edit.

407a4c063ed0045cdfcc91c5d3e1ad77.png

1. Select the VCN route table created earlier (`VCN_RT_HUB_PUBLIC_SUBNET`).
2. Click Save Changes.

76aabda1f4ad93c14f2b196ce66b5012.png

1. Notice that a new VCN route table is active on the hub public subnet.
2. Click Hub VCN to return to the Hub VCN details page.

3dfb22d928211feb80c3575757f1c30c.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Hub VCN Private Subnet

Next, we are going to attach the (`VCN_RT_HUB_PRIVATE_SUBNET`) VCN route table to the private subnet in the hub VCN.

Routing Information: (`VCN_RT_HUB_PRIVATE_SUBNET`) This VCN route table will route traffic that is destined for the spokes to the firewall. Traffic that is destined to the internet (all traffic other than spoke networks) to the NAT gateway will also be routed by this route table.

- Go to the hub VCN.

1. Click Private hub Subnet.

Cf9833a8454ab486c773ad7a8a6a1737.png

1. Notice the private hub subnet has the VCN route table associated already. If you still have the default VCN table associated then change this. To change, click Edit and change this to `VCN_RT_HUB_PRIVATE_SUBNET`.
2. Scroll down.

23ce39008eff817d93940c98f53a2e50.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Hub VCN NAT Gateway

Attach the (`VCN_HUB_RT_NAT_TRANSIT`) VCN route table to the NAT gateway in the hub VCN.

Routing Information: (`VCN_HUB_RT_NAT_TRANSIT`) This VCN route table will route traffic that is destined for the spokes to the firewall.

- Go to the OCI Console.

1. Click NAT Gateways.
2. Notice that the NAT gateway does not have any route table associated.
3. Click the three dots.
4. Click Associate Route Table.

088a9d4b025555fc07f0635a20c3406f.png

1. Select the VCN route table created earlier (`VCN_HUB_RT_NAT_TRANSIT`).
2. Click Associate Route Table.

541dbc6cf5349e9e2dab604cebf148e5.png

- Note that a new VCN route table is active on the hub NAT gateway.

4d470c0224d6636b2fa6a9afb425df8b.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Spoke VCN Private Subnets

We already configured the default spoke VCN routing tables in one of the previous tasks. The spoke (A, B, and C) private subnets will automatically use the default VCN route table and there is no need to change this. We can do a quick check.

Go to the OCI Console, navigate to Networking and Virtual cloud Networks.

- Click spoke VCN A.

Dab2487250f33261824ab2f21e57f011.png

- Click spoke A Private Subnet.

931a83086b36b6c7d0b094c611236b7a.png

1. Note that the Default Route table for Spoke VCN A is used.
2. Click Virtual Cloud Networks to return to the VCN page.

6eee38a1be3dcb3d41b5ea44a36d5d98.png

- Click spoke VCN B.

4e86fd3880b530a651c468f88ed9aa68.png

- Click spoke B Private Subnet.

038d1d95f6c34f26a74bc167526296df.png

1. Note that the Default Route table for Spoke VCN B is used.
2. Click Virtual Cloud Networks to return to the VCN page.

D908c293043e72e878a290ca786c0d9e.png

- Click spoke VCN C.

3479a017b1d498f3ca8a52e84f77b9ca.png

- Click spoke C Private Subnet.

32556fb70401b0e215c48783d7696c84.png

- Note that the Default Route table for Spoke VCN C is used.

90cb43d64259b497c3510c5d5219354f.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Hub and spoke routing within a cloud provider can be confusing and hard to configure. To achieve this we need to configure multiple objects with different types of configuration. Network routing and network security across multiple levels inside the cloud make this confusing.

In this tutorial, we will explain how to configure a hub VCN with three-spoke VCNs. The hub VCN will contain the pfSense firewall and the connection to the internet and OCI services network. All network traffic originating from the spoke VCN that needs to communicate with other spoke VCNs or with the Internet or the OCI services network needs to pass the hub VCN for firewall inspection.

Profile-hub-spoke-vcn.jpg

The following images illustrate the traffic flows.

- Spoke to spoke connectivity

9042c277456af862b22bd979abfa0dad.png

- Spoke to Hub connectivity

A44add88eebd67eee8f5db5bcdb88820.png

- Hub to Spoke connectivity

035795ba5a58d08c93570a93bf006f32.png

- Spoke to Internet connectivity

4ae22781d21c126a7e8b2b685f01eb4c.png

- Spoke to Service connectivity

6aaabd390f6f7b25811188e69a1977f2.png

- Hub to Internet connectivity

06ef2e7ee033879960f036b982ffe568.png

- Internet to Hub connectivity

4b184746df83b08f581dea1233039d7d.png


<aside> In this tutorial, we will use several networks in the spokes.

- Spoke A VCN subnet: `172.16.1.0/25`.
- Spoke B VCN subnet: `172.16.2.0/25`.
- Spoke C VCN subnet: `172.16.3.0/25`. </aside>


Objectives

- Set up an OCI routing environment with hub and spoke routing fully configured. We will route all network traffic to the hub VCN where the hub VCN will contain a firewall that will inspect all the traffic coming from the spokes.

- Task 1: Create the hub and spoke VCNs.
- Task 2: Create the subnets inside the hub and spoke VCNs.
- Task 3: Create a DRG, internet gateway, and a NAT gateway.
- Task 4: Add instances attached to different subnets inside all VCNs.
- Task 5: Add a pfSense firewall in the hub VCN.
- Task 6: Open firewall rules on the security lists.
- Task 7: Configure routing between the different VCNs and the internet with hub firewall inspection.
- Task 8: Verify the connectivity.

Task 1 - Create the Hub and Spoke VCNs

- Log in to the OCI Console and click Virtual cloud Networking or click the hamburger menu (≡), Networking and Virtual cloud networks.

45682715466ca32f5dc53f07af5a1ef9.png

- Click Create VCN to create the VCN.

2c22fbb82501ce49fce292fcbfe5ec45.png

1. Enter the Name for the hub VCN.
2. Enter an IPv4 CIDR Block for the hub VCN.
3. Scroll down.

Cb8a1712e70d36404c205cc13138b83a.png

- Click Create VCN.

D1ab516a601996033eb0cc398ea4aafd.png

1. Notice that the hub VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

B7117a124982eccf5f41bcada6795eb7.png

- The following image illustrates the visual representation of what you have created so far.

17ad73a49abb10c27740ec20032d4516.png

Now, we will create three spoke VCNs (Spoke A, Spoke B, and Spoke C).

- Click Create VCN to create the first spoke VCN (Spoke A).

6528172d1bc68cadb8de27b93ebcdd7a.png

1. Enter the Name for the spoke VCN.
2. Enter an IPv4 CIDR Block for the spoke VCN.
3. Click Create VCN.

71a39dd1d8cb2d633866b9504a636694.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

06e47c532ec0a843fa6587bf8541941b.png

- Click Create VCN to create the second spoke VCN (Spoke B).

70833b6ae8fc0d7dea53e8814295d128.png

1. Enter the Name for the spoke VCN.
2. Enter an IPv4 CIDR Block for the hub VCN.
3. Click Create VCN.

028a5d41bc89a4b7f8a4d0ed3939d70f.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

B2bf3eb4d5acca8dd5a54e12cd77ce16.png

1. Click Create VCN to create the third spoke VCN.
2. Enter the Name for the spoke VCN.
3. Enter an IPv4 CIDR Block for the hub VCN.
4. Click Create VCN.

Bdb44bf8dddb3589dd9abf70ddc4705c.png

1. Notice that the spoke VCN is AVAILABLE.
2. Click Virtual Cloud Networks to return to the VCN page.

826e1cc601516a481aa7fbc4dbae0612.png

- Notice that we have created 1 hub and 3 spoke VCNs.

B719de46166439d61134a5ce314c6508.png

- The following image illustrates the visual representation of what you have created so far.

5e08a741b54d75df80a919144ac4a7ee.png

Task 2 - Create the Subnets inside the Hub and Spoke VCNs

We have the hub and spoke VCNs in place. Now, create subnets inside the VCNs.

Create a Subnet inside Hub VCN

In the hub VCN we will create 1 private subnet and 1 public subnet.

- Click the hub VCN.

D6f125151e5ec54f7fc51cf4775b76bb.png

- Click Create Subnet to create the first subnet (private).

B1825be4d4116f6f9b1db681082b3107.png

1. Enter the Name for the private subnet.
2. In Subnet Type, select Regional.
3. Enter IPv4 CIDR Block for the private subnet.
4. Scroll down.

D84ed53f2407bb7ba568e582e73af5ad.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

3647681139cb3db731ca63225d589285.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

E725e49b0c9cd0b135d7378bdfc64b2e.png

- Notice that the state is set to Provisioning.

331595efbcf4e4f5faff707ff41e52cf.png

1. After a few minutes the state is changed to Available.
2. Click Create Subnet to create the second subnet (public).

12d1e7de41cbdea95096efd03f0ec8b2.png

1. Enter the Name for the private subnet.
2. In Subnet Type, select Regional.
3. Enter IPv4 CIDR Block for the public subnet.
4. Scroll down.

49df7be085a8c305c4c0ef9368e98fed.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Public Subnet.
3. Scroll down.

224f7a163d3f66a320d65d7cab734709.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

A03c5b2338d0301b1b43524775d942b0.png

- Notice that the state is set to Provisioning.

28e266ff9927c5c6664bf22aa0240214.png

- After a few minutes the state is changed to Available.

2d4f7dc81c6d51633258dcda6febd35c.png

- The following image illustrates the visual representation of what you have created so far.

C632adfde5636a5400666d784ac3a635.png

Create a Subnet in Spoke VCN A

Create one private subnet inside the spoke VCN A.

- Click the spoke VCN A.

5a5d18a1211b733b82a96bce878b9b83.png

- Click Create Subnet to create the subnet (private).

Ff12e2c2970f7b7c843657e688266d82.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

1642f9c3c967f77af1faf23e43a3e5b1.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

Ed3bae9e775db00dc35d640a79a0f38a.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

D9a193a370bf94c37ca7f58460c811de.png

- Notice that the state is set to Provisioning.

7adf58d425b4221dad26753f4ac3bfe5.png

1. Notice that the state is changed to Available.
2. Click Virtual Cloud Networks to return to the VCN page.

5e9cbe24446d97300752eb5fb1d4e498.png

- The following image illustrates the visual representation of what you have created so far.

8362f3383f70c00d17d84235a4f60006.png

Create a Subnet in Spoke VCN B

Create one private subnet inside the spoke VCN B.

- Click the spoke VCN B.

49082b6c935ce756a20971326a6f5cc8.png

- Click Create Subnet to create the subnet (private).

F320fb3bd2139aaa37198a7b9d3d9f87.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

9391bc60391c148bc4b56660bfe96f33.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

5e3bd705930cd14671288829f6e610d9.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

Db66b56a8cc880ba914198ad4206bd0f.png

- Notice that the state is set to Provisioning.

Dbb0c8fb621bbe1b6644fd27716a6a10.png

1. Notice that the state is changed to Available.
2. Click Virtual Cloud Networks to return to the VCN page.

57022af393cb8b9466b1d53c70ff3f2c.png

- The following image illustrates the visual representation of what you have created so far.

60071e76eddc1669d6d337ea25e6fea0.png

Create Subnet inside Hub VCN C

Create one private subnet inside the spoke VCN C.

- Click the spoke VCN C.

Eb39479ef5119821664f260a2d62dddd.png

- Click Create Subnet to create the subnet (private).

Bcca55427e9c61ca7902b946ff5c45ff.png

1. Enter the Name for the private subnet.
2. Enter IPv4 CIDR Block for the private subnet.
3. Scroll down.

A7bfa47e7f2b4d17eed75bc9073d0a72.png

1. In Route Table, select the default route table.
2. In Subnet Access, select a Private Subnet.
3. Scroll down.

D18c5d60c2847a8e4447ee0422b6c0af.png

1. In DHCP options, select the default DHCP options.
2. In Security List, select the default security list.
3. Click Create Subnet.

496a7c72fbf6d93f0902d3db2d3967a3.png

- Notice that the state is set to Provisioning.

9261122712598297660ba0e6fc381070.png

- Notice that the state is changed to Available.

B7d1bf9661877fcae257c399d51e0502.png

- The following image illustrates the visual representation of what you have created so far.

0d32a3dfea2a02bd43d140438e7b0797.png

Task 3 - Create a Dynamic Routing Gateway -DRG- and Internet Gateway and a NAT Gateway in the Hub VCN

Create a DRG that will be used to route traffic between the VCNs. We also need to create an internet gateway and a NAT gateway for our access to the Internet.

- Click the hub VCN.

D6f125151e5ec54f7fc51cf4775b76bb.png

- Click Internet Gateways.

59f24061b1a5ed8c71c107734d5bf171.png

1. Click Create Internet Gateway.
2. Enter the Name of the internet gateway.
3. Click Create Internet Gateway.

41afee9a40e292e5d2fcdfb5f72fc029.png

1. Notice that the state is Available.

85c11bdd27f0b4ef0d3890de7a346c6d.png

- The following image illustrates the visual representation of what you have created so far.

15f1ad8b624453a781b30b60d66e6bed.png

1. We are inside the hub VCN configuration page after internet gateway creation. Scroll down.
2. Click NAT Gateways.
3. Click Create NAT Gateway.

08e4e119533787fd4947934ea9e6ad9e.png

1. Enter the Name of the NAT Gateway.
2. Select Ephemeral Public IP Address.
3. Click Create NAT Gateway.

0984c7cf913202138e7f27abf62f645c.png

1. Notice that the state is Available.

Cb26f7efcc7cf2ff6d95ed5f22a4820f.png

- The following image illustrates the visual representation of what you have created so far.

356ffbde99f230a5f1a9b499b5b035bb.png

- Create the Dynamic Routing Gateway (DRG).

1. Click the hamburger menu (≡) icon from the upper left corner.
2. Click Networking.
3. Click Dynamic routing gateway.

4da099a2902c4e56d6228bf0a00c910e.png

- Click Create dynamic routing gateway.

54ff39ed8d970dd6924f493192206d3c.png

1. Enter the Name of the dynamic routing gateway.
2. Click Create dynamic routing gateway.

E3cd9c63511e57953267046f0e8308f2.png

1. Notice that the state is PROVISIONING.

Baf03a18c5cd89e8180ab2da12b2a5a5.png

- Notice that the state is changed to AVAILABLE.

60a96886b67c83d0300c28d7ae54809b.png

- The following image illustrates the visual representation of what you have created so far.

E9e1c4c292397ab31e12deb2a860c96f.png

Task 4 - Add Instances attached to different Subnets inside all VCNs

We will add various OCI Compute instances in all the VCNs so we can test out the routing flows.

Create Instance in Hub VCN

In the hub VCN, we will create a Windows compute instance that will have two main functions:

- The Windows instance will act as a stepstone machine to access the other instances inside our OCI environment.

- The Windows instance will also be a network endpoint that can be used for testing the routing flows.

Windows Instance as Step Stone

To create a Windows instance (hub-step-stone) that can act as a stepping stone inside your OCI environment, use [Deploy a Windows Instance in Oracle Cloud Infrastructure.]


Note

Create the Windows stepping stone instance (hub-step-stone) before you continue with the tutorial.


The following image illustrates the visual representation of what you have created so far.

128a1032b9fe8b9511bf0402531134fd.png

Create Instance in Hub VCN Spoke VCN A

In the spoke VCN A, we will create a simple Linux instance that will act as a network endpoint that we can use to test our routing flows.

Spoke A Client Instance

- Create a instance.

1. Click the hamburger menu (≡) icon from the upper left corner.
2. Click Compute.
3. Click Instances.

75af10535557180792647d213c103b36.png

- Click Create Instance.

Cf8ccd28d528ec4a347aebbb17833de4.png

1. Enter the Name of the instance.
2. Scroll down.

Db9c01fb0261c94365fc38a66984f70e.png

- Scroll down.

99b017b659f3814b1b345b834de80750.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-A.
3. In Subnet, select Select existing subnet.
4. Select Private Subnet from the spoke VCN A.
5. Scroll down.

8b425dda55669021b976cf489b69721c.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

F78baafb934ef8db65ce16b9ddd708dd.png

1. In Add SSH keys, select Generate a key pair for me.
2. Click Save private key to save the private key locally.
3. Click Save public key to save the public key locally.

C48c2b6ec9f01ed1a35ff348c6256355.png

- Make sure the keys are stored somewhere locally.

Note

We will use the same key pair for the other spoke instances.

52c14226785e21f75120b6642cb426d3.png

- Scroll down.

4608959072223e1e9d8b08cef2010b59.png

- Click Create.

E6023a9f239cc00735364b2926d39fab.png

- Notice that the state is PROVISIONING.

Fb8677264c5bc130a7262c3beabe1fdc.png

1. Notice that the state is changed to RUNNING.
2. Note the Private IP address for later.
3. Click Instances to return to the instances page.

Eff27ab9c44d3dfca08bf65b2ee6eeb4.png

1. Notice that the Instance A is running.
2. Click Create Instance to create the next instance.

532a1d64e64ed411518207ad04781c85.png

- The following image illustrates the visual representation of what you have created so far.

94eba5c7fa41ed0fd25c7618a2003483.png

Create Instance in Spoke VCN B

In the Spoke VCN B, we will create a simple Linux Instance that will act as a network endpoint that we can use to test our routing flows.

Spoke B Client Instance

- Create an instance.

1. Enter the Name of the instance.
2. Scroll down.

13b8a132f1cf1289208a9ba316395f26.png

- Scroll down.

6c6379628e2504dc17fe9f8a5af123e0.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-B.
3. In Subnet, select Select existing subnet.
4. Select the Private Subnet from spoke VCN B.
5. Scroll down.

786d2cf77740ad2c0094305ff28b444e.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

3b459af2a2ad100b488ab14684e60807.png

1. Upload public key files.
2. Click Browse. Select the public key file you saved when you created instance A.
3. Make sure the public key is selected.
4. Scroll down.

7261c3fa95b0fbbb9134300b1bbb431d.png

- Scroll down.

E9b9d9274735fa2eaef987eeceb71c35.png

- Click Create.

6cbfddb23735cde1ed16a70074e3746c.png

- Note that the state is PROVISIONING.

Af4a133daac894198701b4cc02daa95f.png

1. Note that the state is changed RUNNING.
2. Note the Private IP address to be used in a later step.
3. Click Instances to return to the instances page.

9da61504451fbde20ffd5e7d500c84ea.png

1. Note that Instance B is Running.
2. Click Create Instance to create the next instance.

4f130afc8f86ef7d68fb50050559d627.png

- The following image illustrates the visual representation of what you have created so far.

38ec499ffd092f2759835bd35869f66b.png

Create Instance in Spoke VCN C

In the Spoke VCN C, we will create a simple Linux instance that will act as a network endpoint that we can use to test our routing flows.

Spoke C Client Instance

- Create an instance.

1. Enter a name of the instance.
2. Scroll down.

D89810970bd5a662b568dcdd6789e9ff.png

- Scroll down.

6f559a7a29d450f6fbd3d6881ee8e724.png

1. In Primary network, select Select existing virtual cloud network.
2. In VCN, select SPOKE-VCN-C.
3. In Subnet, select Select existing subnet.
4. Select the Private Subnet from the spoke VCN C.
5. Scroll down.

3a5a30798450d5c21e71b5d4a3f531fc.png

1. In Private IPv4 address, select Automatically assign private IPv4 address.
2. Scroll down.

07826edd5e7cb76cec679790f2e5a2c9.png

1. Upload public key files.
2. Click Browse. Select the public key file you saved when you created instance A.
3. Make sure the public key is selected 4. Scroll down.

B9c5b3c7b219616935907034e5402547.png

- Scroll down.

E6b8eb433b2b4c6bb7df8fd3e2eac380.png

- Click Create.

6e65fd19cb8c07071055d83cb56a7142.png

- Notice that the state is PROVISIONING.

Acfc4695fff87777f12faff9671b88a6.png

1. Notice that the state is changed to RUNNING.
2. Note the Private IP address for later.
3. Click Instances to return to the instances page

8aab6f0a9ba85a4b633e43c5e0a1ff19.png

- Notice that the Instance C is running.

6f05e20c085fc6b278ef7c89ed70d25d.png

- The following image illustrates the visual representation of what you have created so far.

687e141ff94d071f637a9d829d6106c7.png

Task 5 - Add a pfSense Firewall Instance in the Hub VCN

The last instance we need for our network setup is a firewall. For example, this can be any firewall like the OCI Network Firewall. In this tutorial, we will use the pfSense firewall.

To create a pfSense instance (`hub-fw`) which can act as a firewall inside your OCI environment, use [this tutorial.]


Note

Create the pfSense instance before you continue the tutorial.

The following image illustrates the visual representation of what you have created so far.

E787ca1d73f90ee3d6cf79f2309a1d49.png

Task 6 - Open Firewall Rules on the Security Lists

In an OCI environment, there are multiple layers of network security. By default, all ingress network traffic is blocked for most protocols and ports. To make testing with ping possible we will open the ICMP ports on the hub and spoke VCNs so that we can allow all ICMP traffic that is coming into the VCN.

Add Ingress Rule in Hub VCN

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Virtual Cloud Networks or navigate to Networking and Virtual Cloud Networks.

Bfbf9ebc41a70f2ae52213091e40cb3d.png

- Select the hub VCN to which your pfSense firewall is attached.

D6315b3654dd2b6dbe4e136691ccac21.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for HUB-VCN.

9544779687129ea524ed4d85320c4b81.png

- Click Add Ingress Rules.

A4c088f501942467d43f57a1f19fbddf.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

781040ff9b9bec94580b5eb148351bbc.png

- Note the ICMP rules is added.

Cc6c159a12691eb43f9a3ac3709792ac.png

- Click Virtual cloud networks to return to the VCN page.

5940eda4f57cb06c15fe5da5fc592a9a.png

- The following image illustrates the visual representation of what you have created so far.

6111813a9a5abc601564ba6cc3bd5965.png

Add Ingress Rule in Spoke VCN A

- Click the spoke VCN A.

Dcd18615fd8b03cae55e11e5051a91b4.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-A

A205d822e9c68c5b0ed3d943a7a1b363.png

- Click Add Ingress Rules.

3f111c50bfaf6f0653c6a0d1abc56f9a.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

C8833776945f089d0c147b086e0dc032.png

- Notice the ICMP rule is added.

D1d1eb004dc84bb5fd61b14b145ad6e3.png

- The following image illustrates the visual representation of what you have created so far.

05a5da2c5788173cb6bb1244606d0375.png

Add Ingress Rules in Spoke VCN B

- Click the spoke VCN B.

A0cafdfc2beb319e482ae1e2bf6e7499.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-B

9ab7df73f9851bb8d8943372a2089ab2.png

- Click Add Ingress Rules.

8c745ab425d3bd63abcba555b67e3743.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

44fd6bbcbda4cb3442429ea8f2b88f8d.png

- Note the ICMP rule is added.

8e5871cddcb9ab353368085d6ba8f8a8.png

- The following image illustrates the visual representation of what you have created so far.

09990a8b6f84f968c800222588e7fb6e.png

Add Ingress Rules in Spoke VCN C

- Click spoke VCN C.

9e6582ffa04eee40d61491d09dbd8ce0.png

1. Scroll down.
2. Click Security Lists.
3. Click Default Security List for SPOKE-VCN-C

B77e591bc90223ac8d927280fb1df173.png

- Click Add Ingress Rules.

8ed522bc8a698e70b772ae8c6321c027.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `0.0.0.0/0`.
3. In IP Protocol, select ICMP.
4. Click Add Ingress Rules.

120d027cc4ccac10cf7c07b71ab09c10.png

- Note the ICMP rule is added.

Fdbb69d6d43af43b149f7f778300b48e.png

- The following image illustrates the visual representation of what you have created so far.

65a6625e95dcd0416a592593b91ebd38.png


Task 7 - Configure Routing between the different VCNs and the Internet with Hub Firewall Inspection

We already have all the required components. Now, we need to configure routing. Before we can configure routing we need to first attach the VCNs to the DRG.

After this, we will create the attachments that we need to create different VCN routing tables, DRG routing tables and to associate these routing tables to different VCNs, DRG VCN attachments, subnets, and gateways.

Task 7-1 - Create VCN Attachments on DRG

- Create VCN attachments on the DRG.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Dynamic Routing Gateway.

4d867d87b819856daed60615b77f702c.png

- Click the DRG created in Task 3.

Cb99517258e3371198a09798210fc1b3.png

1. Click VCN attachments.
2. Click Create virtual network attachment.

8dbaa1328444f4f70579ef694df7901d.png

1. Enter a Attachment name for the hub VCN.
2. Select the hub VCN.
3. Click Create VCN attachment.

757625231f469080232a5535b807bd50.png

- Notice that the hub VCN state is Attaching.

1e4a31a12516f675c8ea4f3092645c10.png

- The following image illustrates the visual representation of what you have created so far.

9c39bad8084c7b82bc9770896074936f.png

1. Notice that the hub VCN state changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

615b7e689c03f65f5d474d051eb02f55.png

1. Enter Attachment name for the spoke VCN A.
2. Select the spoke VCN A.
3. Click Create VCN attachment.

B191d90fa35dba807f01ad170f37e2ad.png

- Note that the spoke VCN A state is Attaching.

D9c3b488f8dd852ea752d12e8c5c9fbb.png

- The following image illustrates the visual representation of what you have created so far.

3c7dcefc1786c42515f7fa4018a85291.png

1. Note that the spoke VCN A state has changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

9dec2338605851624f140f6d85b17f0b.png

1. Enter Attachment name for the spoke VCN B.
2. Select the spoke VCN B.
3. Click Create VCN attachment.

Ee97e4d98b2e60488408ee9dfe3cdbd0.png

- Note that the spoke VCN B state is Attaching.

0b556d2cf97d5f9c35dfa8cc264b61b3.png

- The following image illustrates the visual representation of what you have created so far.

90f7d1b60e98489fcce84e031b190867.png

1. Note that the spoke VCN B state has changed to Attached.
2. Click Create virtual network attachment to create the next attachment.

7e201f62e114c63477c17bd3eab3b184.png

1. Enter a Attachment name for spoke VCN C.
2. Select spoke VCN C.
3. Click Create VCN attachment.

0cfd6ab0ed3d868fd3cad465fbc63c07.png

- Note that the spoke VCN C state is Attaching.

0ab9551cdc24fca529ecb8e66a645119.png

- Note that the spoke VCN C state has changed to Attached.

4beaf8bf96fc068ff72cd6a611795e7b.png

- The following image illustrates the visual representation of what you have created so far.

9b2a6803d6e150992f75736b2feca7ee.png

Task 7-2 - Create and Configure Spoke VCN Routing Tables

We need to create two types of routing tables: VCN Routing Tables and DRG Routing Tables.

Note

By default when you create a VCN, a default routing table is created.

- Spoke VCN A only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

4c46d77b468378eee19d957aa0b85017.png

- Click spoke VCN A.

E201582495789cffa589aab9816966d2.png

1. Click Route Tables.
2. Click Default route table for SPOKE-VCN-A.

Aca368d38777093c627fc871541f8858.png

- Click Add Route Rules.

Ebc349d6c21766b0022ee850d08df9ce.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN A to the DRG.

F0f528bd3ebcb4c0db20aac73c2a6a7d.png

1. Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN A.
2. Click Virtual cloud networks to return to the VCN page.

64b2712c2c7e2aa50a1e6a6b15206c7f.png

- The following image illustrates the visual representation of what you have created so far.

76dc100fa42dc549165ab3ad83518f75.png

- Spoke VCN B only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

- Click spoke VCN B.

A81cfff309cb4c0b7ffc13ef3c35eda1.png

1. Click Route Tables.
2. Click Default Route Table from SPOKE-VCN-B.

9df1aaf8b80cea4098a533ea480b1b9a.png

- Click Add Route Rules.

E0a9992006018bb27a279d4366f8bad0.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN B to the DRG.

Eb02ade02d36f4efd4b863cad6fbc870.png

1. Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN B.
2. Click Virtual cloud networks to return to the VCN page.

0e8385516d797d32704990f7f74b13bf.png

- The following image illustrates the visual representation of what you have created so far.

Befce1297858072ad3f62fbe587e3c45.png

- Spoke VCN C only has the default VCN routing table.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static

- Click spoke VCN C.

41f99ed388234a45915b740d1eb57dc7.png

1. Click Route Tables.
2. Click Default Route Table for SPOKE-VCN-C.

Fa581b11b3a73f6f5800e7892984f934.png

- Click Add Route Rules.

08d058adb9fa26707e88c75b1aafe629.png

1. In Target Type, select the Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `0.0.0.0/0`.
4. Click Add Route Rules.

- This rule will route all traffic coming from spoke VCN C to the DRG.

5568679ad0b0f25cb9b2c617c09990cb.png

- Note that the `0.0.0.0/0` route is now added to the default route table of spoke VCN C.

69b83ca03b9f53d836a060ffc52f9913.png

- The following image illustrates the visual representation of what you have created so far.

4eb98fcd3d5e9bdc79b8d9433765e2b1.png

Task 7-3 - Create and Configure Hub VCN Routing Tables

- Create a route table (`VCN_HUB_RT_DRG_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 Private IP 172.16.0.20 (FW IP) Static
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static


Note

To route the traffic that is going from spoke to spoke VCN's we also need to add in the specific routes in this route table as the default `0.0.0.0/0` is not enough to make this work.

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

26a1ac3da51de3612f4e0bf4d667c27b.png

- Click the hub VCN.

2623d4766b66ce9095b13c24fb7415de.png

1. Click Route Tables.
2. Click Create Route Table.

23e383fde8f4dc7b7c120f8495b1660c.png

1. Enter the Name of the new hub VCN route table.
2. Click + Another Route Rule (not in the screenshot).
3. In Target Type, select Private IP.
4. Scroll down.

Abad73f35190c9d894a9ab0cf0e32cd2.png

1. In Destination Type, select CIDR Block.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
4. Click Create.

43aa5f4d1fbc40272a288e0f2cf1f209.png

1. Note that you will get the following error: `PrivatelP (ocid 1.privateip.oc1.eu-frankfurt-1.abtheljtrcahk23t4vtbeguxxxxxxxxxxxxxxxxxvwbgypf36ad4cyjmka) is an invalid route target. (The Private IP is attached to a VNIC whose SRC/DST check is enabled)`.

2. Click Cancel.

139e68c6a288353bac05fe5d9c765b62.png

- To fix this, we need to enable the skip source/destination check on the pfSense firewall instance VNIC.

1. Click the hamburger menu (≡).
2. Click Compute.
3. Click Instances.

967fec9a4252d1b6b10fc1f5831a1b15.png

- Click the `hub-fw` (pfSense instance).

8c227e63780db6bb655cc3975e01ec02.png

- Scroll down.

825bde99220cbdf7d9916e80a7e74c9b.png

1. Click Attached VNICs.
2. Click the three dots of the VNIC.
3. Click Edit VNIC.

733b2d5ee226a34399d59579720301f3.png

1. Select Skip source/destination check.
2. Click Save changes.

D503a89b324cfd00bd1732959cd4d2aa.png

- Now, create the hub VNC routing tables.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

F6524cc5d46d3a70d651741aadfde06c.png

- Click the hub VCN.

74806a4e6aea8684c71e5edbb7eb4163.png

1. Click Route Tables.
2. Click Create Route Table.

D4259b610f864ce94659d30c90ee45a4.png

1. Enter the Name for the new hub VCN route table.
2. Click + Another Route Rule.

7675a77b5bd7d3bf485e75312c705440.png

1. InTarget Type, select Private IP.
2. Scroll down.

1dcd279170fb749736c8e8b99ebe9a0c.png

1. In Destination Type, select CIDR Block.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
4. Click Create.

9c532adb8d6278f5f65a1826f33d59ac.png

- We need to add three more routes to the `VCN_HUB_RT_DRG_TRANSIT` route table.

- Click Add Route Rules.

9c7ccb4d400833ee1f174fa3d123864a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

Bd74d0390983c77d0fc725700ff9b07a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

908859432bba07b5cb7ebf2f6418a3ef.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Click + Another Route Rule.

B9ee7cd41cf127ca26fa3502390ff956.png

1. Note that the 4 route rules created.
2. Click the Hub VCN to return to the Hub VCN page.

Ea8bf47d0faa7b5e06488f4b9f90d527.png

1. Note that the hub VCN routing table is now in the list.
2. Click Create Route Table again to create another hub VCN route table for the public subnet.

C825241d039d1f2d6c9a643531da05bb.png

- The following image illustrates the visual representation of what you have created so far.

7538f47aaa1ee85b3b4bfad14654cb2e.png

- Create a route table (`VCN_RT_HUB_PUBLIC_SUBNET`) in the hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 Internet Gateway hub-internet-gateway Static
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static

- Create route table.

1. Enter the Name for the new hub VCN route table for the public subnet.
2. Click + Another Route Rule.

D0c1f4d0b628b3a10baef485170f8271.png

1. In Target Type, select Internet Gateway.
2. In Destination CIDR Block, enter `0.0.0.0/0`.
3. Scroll down.

Fedca2d366a46d24a06aca4278618d8b.png

1. In Target Internet Gateway, select the internet gateway you created earlier.
2. Click + Another Route Rule.

A59f0ada42355a9909ba4840d9305a69.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

7436dd89abcc46b14f30f067b3308661.png

- Click + Another Route Rule.

3061d7a223656ea905cb666eae976cb3.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

C363451b02971397b196006013740a64.png

- Click + Another Route Rule.

Ed5e91df2385274526e454d7fee0899e.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

C2f540a6dd6ea6d98324009e598871a9.png

1. Note that the route table for the public subnet is created. Click the routing table name.
2. Also, note that this routing table contains 4 routing rules.

56f8512ff6afee56345aa5b624aded4c.png

- Note if the 4 route rules are present.

92a3d2df89fdd94f04ed27a290ead991.png

1. Scroll up.
2. Click the Hub VCN to return to the Hub VCN page.

4fc93e7f7c28d17aa79ba07ce4a80228.png

- The following image illustrates the visual representation of what you have created so far.

0c9053f6cbffce926dce08eca972e7a2.png

- Create a route table (`VCN_HUB_RT_NAT_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
172.16.1.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.2.0/24 Private IP 172.16.0.20 (FW IP) Static
172.16.3.0/24 Private IP 172.16.0.20 (FW IP) Static

1. Click Route Tables.
2. Click Create Route Table again to create another hub VCN route table for the NAT gateway.

Aa6c3c38e8fe825071d66dfaa222a095.png

1. Enter the Name for the new hub VCN route table for the NAT gateway.
2. Click + Another Route Rule.

9eb32ec75cb6552221d8e606715555c1.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

Bdab8cf97497ff287edefd53c7bf8a11.png

- Click + Another Route Rule.

4b0358c48ea54d2d38bd96c8bf64b74a.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

 C2ba20cab89ed41a1c5500dc8e40c072.png

- Click + Another Route Rule.

50f907c0fca100959a8cb843b5954e9f.png

1. In Target Type, select Private IP.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. In Target Selection, enter `172.16.0.20` (this is the IP address of our pfSense firewall).
5. Scroll down.

43e0740d175766d7f21ca061ee31e1da.png

1. Note that the route table for the NAT gateway is created. Click the routing table name.
2. Also, note that this routing table contains 3 routing rules.

473e47680f31aa458f69bcd40d44436a.png

1. Note the 3 route rules we created.
2. Click Hub VCN to return to the Hub VCN page.

B8bbc3e521c919887fa1e531f9736a39.png

- The following image illustrates the visual representation of what you have created so far.

492aab841cbc96726a498a5f7e703c4f.png

- Create a route table (`VCN_RT_HUB_PRIVATE_SUBNET`) in the Hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 NAT Gateway hub-nat-gw Static
172.16.1.0/24 Dynamic Route Gateway DRG Static
172.16.2.0/24 Dynamic Route Gateway DRG Static
172.16.3.0/24 Dynamic Route Gateway DRG Static

1. Click Route Tables.
2. Click the routing table for the private subnet. If you do not have this table, then create it. To create the route table, click Create Route Table.

2e3542875da0763a63a0b1f9f0dbba28.png

1. Note that there is already one route rule present that will route all traffic (`0.0.0.0/0`) to the NAT gateway for the private subnet instances.
2. Click Add Route Rules.

26c48cc637d5dc3177363775de654837.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. Click + Another Route Rule.

D8410bbf108b6cc3d69233414590cbbd.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. Click + Another Route Rule.

60cfe96359682df13ffc40df6c06c748.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. Click Add Route Rules.

313d646f11d90ebf5e28992aca4c098c.png

- Note all the route rules for the private subnet routing table.

8198ea3d3f1a0711269e050e171f9646.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Task 7-4 - Create and Configure DRG Routing Tables

- Create a route distribution group (`DRG_RDG_IMPORT`) in the DRG.

Priority Match Type Match Criteria Action
1 Attachment SPOKE_VCN-A_ATTACHMENT ACCEPT
2 Attachment SPOKE_VCN-B_ATTACHMENT ACCEPT
3 Attachment SPOKE_VCN-C_ATTACHMENT ACCEPT

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Dynamic routing gateway.

D75a09fa9f7f3ff85b88f69de5746fd0.png

- Click the DRG created in Task 3.

66b4635cc31f32ac520a5b299783a11e.png

1. Click Import route distribution.
2. Click Create import route distribution.

8aa3785008c91e77095cca4cdc61accb.png

- In the Create import route distribution page, enter the following information.

1. Enter the Name for the route distribution.
2. Create a new route distribution statement.

   - Priority: Enter 1.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN A.
   - Action: Select Accept.


3. Create a new route distribution statement

   - Priority: Enter 2.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN B.
   - Action: Select Accept.


4. Create a new route distribution statement

   - Priority: Enter 3.
   - Match Type: Select Attachment.
   - Attachment type filter: Select Virtual Cloud Network.
   - DRG attachment: Select spoke VCN C.
   - Action: Select Accept.


5. Click Create import route distribution.

20d66f4211e11fb3a4b5b689b9576604.png

- Click the new import route distribution.

892f940c7eba9ed0b1b3547eca4db1a7.png

1. Note the route distribution statements.
2. Click Dynamic routing gateways details to return to the DRG details page.

C4a2766fb2f1cebcf96889461a0915a5.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Create a route table (`DRG_RT_SPOKE_VCN_2`) in the DRG.

Destination CIDR Next Hop Attachment Type Next Hop Attachment Name
0.0.0.0/0 Virtual Cloud Network HUB_VCN_ATTACHMENT

1. Click DRG route tables.
2. Click Create DRG route table.

C77fea88e16a89d6beb7bafd5c0c254c.png

1. Enter the Name for the DRG route table.
2. Add a new static rule:

   - Destination CIDR Block: Enter `0.0.0.0/0`.
   - Next hop attachment type: Select Virtual Cloud Network
   - Next hop attachment: Select hub VCN.


3. Click Create DRG route table.

6a9ba8ea00f9ea01c08e5c5c826c5223.png

- Wait for the creation of the route table.

E8135524164341303553778da43ead5a.png

1. Note that the new DRG route table is created.
2. Click Create DRG route table to create another DRG routing table.

7c22001115333c5b2d3126859c04495a.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Create a route table (`DRG_RT_HUB_VCN_3`) in the DRG and import the route distribution group (`DRG_RDG_IMPORT`).

1. Enter the Name for the DRG route table.
2. Click Show Advanced options.

C977525ce905e58726e5c2ba76128c74.png

- Import the Import Route Distribution created earlier.

1. Click Route table settings.
2. Select Enable import route distribution.
3. Select the import route distribution created earlier.
4. Click Create DRG route table.

17722f474af2c4cba4fdf084972c17f5.png

1. Notice that the new DRG route table is created.

E211bb741686e51ae80b237bcd282a62.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Task 7-5 - Attach the Route Tables

Now that we have created route tables, we need to attach the route tables to the DRG, VCNs, subnets, and gateways.

Note

This is where routing is activated, so this is a careful process that needs to be thought of first and properly tested before you implement or make changes in a Production environment.

Attach the DRG Route Tables:

Let us first attach the DRG routing tables.

Attach DRG Routing Tables to the Spoke VCN Attachments

Routing Information: (`DRG_RT_SPOKE_VCN_2`) This DRG route table and route table attachment will make sure that all traffic that is coming from the spoke VCNs, is now routed to the hub VCN.

First, we are going to attach the ()`DRG_RT_SPOKE_VCN_2`) DRG Routing table to all the spoke VCN attachments.

- Go to the DRG page. Click Networking, Dynamic Routing Gateway and select the DRG created earlier.

1. Click VCN attachments.
2. Click the VCN attachment for Spoke A.

Dcb8fd665203d9d9ce26c1252883a08c.png

1. Note that the VCN attachment for Spoke A has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

B5d0d956a3a3dd12b6acb9aaa8e2ca19.png

- Click Show Advanced options.

961181374272d51fe6c04555fc8320ff.png

1. Select the DRG route table.
2. Select the DRG route table created earlier: `DRG_RT_SPOKE_VCN_2`.
3. Click Save Changes.

405618e474198b57089d711248dc6ab4.png

1. Note that a new DRG route table is active on the spoke A VCN attachment.
2. Click DRG to return to the DRG details page.

7429c1fca7e993786cbc00d4a03b776d.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Click the VCN attachment for spoke B.

C1bab2cc6b16107a44b6bae34774f6a7.png

1. Note that the VCN Attachment for spoke B has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

5cfaaf4ca15ef4c85ea22fca052b98d2.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_SPOKE_VCN_2`).
4. Click Save Changes.

00af855b3e994e2af8fae7864a2cdb6b.png

1. Note that a new DRG route table is active on the spoke B VCN attachment.
2. Click DRG to return to the DRG details page.

0c5da1731f23bf24bfbb7e3e033f7e21.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Click the VCN attachment for spoke C.

86bbef5f00ffe32640c175a97818c455.png

1. Note that the VCN attachment for spoke C has the autogenerated DRG table associated. We need to change this.
2. Click Edit.

05ed5e25e45a3b1eaa456853f86a4ea1.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_SPOKE_VCN_2`).
4. Click Save Changes.

755d4892537d1aa2b8d9e3e40ad7440e.png

1. Note that a new DRG route table is active on the spoke VCN C attachment.
2. Click DRG to return to the DRG details page.

274f1200a29a52ce9bbc7413693dd0f1.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach DRG Routing Tables to the Hub VCN Attachment

We will attach the ()`DRG_RT_HUB_VCN_3`) DRG route table to the hub VCN attachment. We are also going to attach the (`VCN_HUB_RT_DRG_TRANSIT`) VCN route table to the hub VCN attachment.

Routing Information: (`DRG_RT_HUB_VCN_3`) This DRG route table and route table attachment will make sure that all networks from the spokes are known on the DRG and learned on the DRG so that the DRG knows what networks are available on the spokes and so it knows where to route the spoke networks to.

Routing Information: (`VCN_HUB_RT_DRG_TRANSIT`) This VCN route table and route table attachment will make sure that all traffic is routed to the firewall in the hub.

- Go to the DRG page. Click Networking, Dynamic Routing Gateway and select the DRG created earlier.

1. Click VCN attachments.
2. Click the VCN attachment for the hub.

62d0ea1c19018dd0df49eb02dcbf48a8.png

1. Note that the VCN attachment for the hub has the autogenerated DRG table associated. We need to change this.
2. Note that the VCN attachment for the hub has no VCN table associated. We need to add this.
3. Click Edit.

Ef6706269583637c42c67aff951a182e.png

1. Click Show Advanced options.
2. Select the DRG route table tab.
3. Select the DRG route table created earlier (`DRG_RT_HUB_VCN_3`).
4. Click the VCN route table tab.

4cd435fcce4165a763fc4008da412305.png

1. Select Select existing to select an existing VCN route table.
2. Select the VCN route table created earlier (`VCN_HUB_RT_DRG_TRANSIT`).
3. Click Save Changes.

5577fbfb63a1ce6175129fd5afdd3438.png

1. Note that a new DRG route table is active on the hub VCN attachment.
2. Note that a new VCN route table is active on the hub VCN attachment.

0b8fe36b50c1bc755fed5f62febbbc09.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach the VCN Route Tables:

Now, we are going to attach the VCN route tables even though we already started doing this for one of the VCN route tables in the previous task.

Attach VCN Routing Tables to the Hub VCN Public Subnet

Attach the (`VCN_RT_HUB_PUBLIC_SUBNET`) VCN route table to the the public subnet in the hub VCN.

Routing Information: (`VCN_RT_HUB_PUBLIC_SUBNET`) This VCN route table will route traffic that is destined for the spokes to the firewall. Traffic that is destined to the internet (all traffic other than spoke networks) to the internet gateway will also be routed by this route table.

- Go to the OCI Console.

1. Click the hamburger menu (≡) from the upper left corner.
2. Click Networking.
3. Click Virtual cloud networks.

Eb29eed5ef16e18e3ab4cebe0d58b3f0.png

- Click the hub VCN.

F6e514b14fcf2b94599719aefc65a978.png

1. Click Subnets.
2. Click Public hub Subnet.

Ba94762eeae2f503e1d18cca479c5cc1.png

1. Notice the public hub subnet has the default VCN table associated. We need to change this.
2. Click Edit.

407a4c063ed0045cdfcc91c5d3e1ad77.png

1. Select the VCN route table created earlier (`VCN_RT_HUB_PUBLIC_SUBNET`).
2. Click Save Changes.

76aabda1f4ad93c14f2b196ce66b5012.png

1. Notice that a new VCN route table is active on the hub public subnet.
2. Click Hub VCN to return to the Hub VCN details page.

3dfb22d928211feb80c3575757f1c30c.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Hub VCN Private Subnet

Next, we are going to attach the (`VCN_RT_HUB_PRIVATE_SUBNET`) VCN route table to the private subnet in the hub VCN.

Routing Information: (`VCN_RT_HUB_PRIVATE_SUBNET`) This VCN route table will route traffic that is destined for the spokes to the firewall. Traffic that is destined to the internet (all traffic other than spoke networks) to the NAT gateway will also be routed by this route table.

- Go to the hub VCN.

1. Click Private hub Subnet.

Cf9833a8454ab486c773ad7a8a6a1737.png

1. Notice the private hub subnet has the VCN route table associated already. If you still have the default VCN table associated then change this. To change, click Edit and change this to `VCN_RT_HUB_PRIVATE_SUBNET`.
2. Scroll down.

23ce39008eff817d93940c98f53a2e50.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Hub VCN NAT Gateway

Attach the (`VCN_HUB_RT_NAT_TRANSIT`) VCN route table to the NAT gateway in the hub VCN.

Routing Information: (`VCN_HUB_RT_NAT_TRANSIT`) This VCN route table will route traffic that is destined for the spokes to the firewall.

- Go to the OCI Console.

1. Click NAT Gateways.
2. Notice that the NAT gateway does not have any route table associated.
3. Click the three dots.
4. Click Associate Route Table.

088a9d4b025555fc07f0635a20c3406f.png

1. Select the VCN route table created earlier (`VCN_HUB_RT_NAT_TRANSIT`).
2. Click Associate Route Table.

541dbc6cf5349e9e2dab604cebf148e5.png

- Note that a new VCN route table is active on the hub NAT gateway.

4d470c0224d6636b2fa6a9afb425df8b.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Attach VCN Routing Tables to the Spoke VCN Private Subnets

We already configured the default spoke VCN routing tables in one of the previous tasks. The spoke (A, B, and C) private subnets will automatically use the default VCN route table and there is no need to change this. We can do a quick check.

Go to the OCI Console, navigate to Networking and Virtual cloud Networks.

- Click spoke VCN A.

Dab2487250f33261824ab2f21e57f011.png

- Click spoke A Private Subnet.

931a83086b36b6c7d0b094c611236b7a.png

1. Note that the Default Route table for Spoke VCN A is used.
2. Click Virtual Cloud Networks to return to the VCN page.

6eee38a1be3dcb3d41b5ea44a36d5d98.png

- Click spoke VCN B.

4e86fd3880b530a651c468f88ed9aa68.png

- Click spoke B Private Subnet.

038d1d95f6c34f26a74bc167526296df.png

1. Note that the Default Route table for Spoke VCN B is used.
2. Click Virtual Cloud Networks to return to the VCN page.

D908c293043e72e878a290ca786c0d9e.png

- Click spoke VCN C.

3479a017b1d498f3ca8a52e84f77b9ca.png

- Click spoke C Private Subnet.

32556fb70401b0e215c48783d7696c84.png

- Note that the Default Route table for Spoke VCN C is used.

90cb43d64259b497c3510c5d5219354f.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Task 8 - Verify the Connectivity

The routing is configured for the full environment. Now, we can test if routing is working.

Task 8-1 - Connect to the Spoke Step Stone Instance with RDP

We connect to the Windows stepping stone using RDP through the internet. The traffic will be routed through the internet gateway.

50710eb0cf2d31d8ef966eb2e030aee0.png

When you are successfully connected, you will be able to see the desktop. From this desktop, we will perform some ping tests and perform management on the pfSense hub firewall.

D375d9aa2bdba481b8b93304237d4ce2.png

Task 8-2 - Ping from Hub VCN to Spoke VCN

The first ping test that we are going to do is from the hub-step-stone to the spoke VCN instances.

- Due to routing configuration:

- The traffic will be sent to the pfSense firewall.
- The pfSense firewall will allow or deny the traffic based on the configured firewall rules.
- When the ICMP traffic is accepted it will route the traffic to the DRG.
- The DRG will then route the traffic to the correct spoke VCN.

A7218a0cc1d9fe0e4a0dee0d2159d82c.png

1. Do a ping to spoke VCN instance A IP address from the hub-step-stone.
2. Notice that we have 0% packet loss so the ping is successful.
3. Do a ping to the spoke VCN instance B IP address from the hub-step-stone.
4. Notice that we have 0% packet loss so the ping is successful.
5. Do a ping to spoke VCN instance C IP address from the hub-step-stone.
6. Notice that we have 0% packet loss so the ping is successful.

0fd1ae6de207c0d5f7bf4789244810c0.png

- These pings are all successful because we have a firewall rule in place in the pfSense hub firewall that allows all ICMP traffic. When we created the pfSense firewall in this tutorial: [Install a pfSense Firewall in Oracle Cloud Infrastructure] we added this firewall rule.

798466bbe80f48ebfb22d5ed2890c8ab.png

Task 8-3 - Connect to the Spoke Instances with SSH

The ping (ICMP) is working in Task 8.2. Now, let us connect to the spoke instances with SSH because we also need to perform some connectivity tests from the spoke instances.

- Due to routing configuration:

- The traffic will be sent to the pfSense firewall.
- The pfSense firewall will allow or deny the traffic based on the configured firewall rules.
- When the SSH traffic is accepted it will route the traffic to the DRG.
- The DRG will then route the traffic to the correct spoke VCN.

Fe98cc954a0d2ac098beaba66d829a2e.png

- For this tutorial, I have preconfigured all the SSH sessions in Royal TSX application.

4accce2ce1b18db6ecfeb58c8ef08f20.png

1. Connect to the spoke VCN A instance.
2. Note that the connection is trying to get through.

7215e6d8bfc2bc83660dddd5bfa2c0fb.png

- Note that the connection is timing out. The reason for this is that we do not have a firewall rule in the pfSense hub firewall that allows TCP/`22` (SSH) traffic.

8be36e9b7becbd9dfd6e5b81d652eb3c.png

- Connect to the pfSense Management Console.

1. Click on the Firewall drop-down menu.
2. Click Rules.

0a64d0db24f6054b9f0d851f736ebe0d.png

- Click Add.

28357efcf332e784c768a97f65b0d4eb.png

1. In Action, select Pass.
2. In Protocol, select TCP.

Fca55eed20520e9f96a3ff712a89d3fc.png

1. In Destination Network, enter `172.16.1.0/25`.
2. In Destination Port Range, select SSH (22).
3. Click Save.

40524c9251a61175edfea4ff0f1a21ce.png

1. Note that the firewall rule is now present to allow SSH to the spoke VCN A network.
2. Click Apply Changes.

Ecc9bc4be9c58ad2573d09749eee1ced.png

- Note that the changes have been applied successfully.

6a41e584362162e3de41a8713f273dfc.png

1. Connect to the spoke VCN A instance again.
2. Notice that we get a question to cache the SSH fingerprint for the VCN A instance as this is our first connection ever.
3. Click Yes.

4612cc293eb6c329e6857597c207697a.png

- Notice that the connection from the hub-step-stone towards the spoke A instance with SSH is now successful.

6015674cba4ea26c7a0f65968ee7b7e7.png

- We have only allowed the spoke A network, but we also need to add rules for the spoke B and spoke C networks. Go back to the psSense Management Console.

- Clone/Copy/Duplicate the rule we created to allow SSH to the spoke A VCN.

D5048de7653f599caa6393fc7120e1ed.png

1. Change the Destination to `172.16.2.0/25`.
2. Click Save.

7ae16f415df8eeb85ccf413b464660ec.png

1. Note that the firewall rule is now present to allow SSH to the spoke VCN B network.
2. Click Apply Changes.

6a97e20e1c5fe69b963aefad9d25576e.png

- Clone/Copy/Duplicate the rule we created to allow SSH to the spoke B VCN.

Bd174783f1adc49fc8f4dbe494d8f236.png

1. Change the Destination to `172.16.3.0/25`.
2. Click Save.

1bc9acd922e40746d4f1aec4182136ca.png

1. Note that the firewall rule is now present to allow SSH to the spoke VCN C network.
2. Click Apply Changes.

0ea19a64c30715737a413fb2b95e48c0.png

- Note that the changes have been applied successfully.

B3a4cb78b312592b0fa7bb3ce06b19cf.png

- Connect to all spoke instances with SSH.

B5dc21c1c2f7aaadab0f1a8995f01bdb.png

Issue: SSH sessions are terminated after a few seconds. We noticed that the SSH connections were dropping after approximately 10 seconds and we troubleshooted this issue on multiple levels. We checked the security lists in OCI, routing in OCI, and the firewall rules in the pfSense. Eventually, we found that the SSH drops issue is related to pfSense.

- To solve the SSH drop issue, go to the pfSense Management Console.

1. Click on the System drop-down menu.
2. Click Advanced.

Bb96374822b02d2ed395c810e573e059.png

1. Click Firewall & NAT.
2. Select Clear invalid DF bits instead of dropping packets 3. In Firewall Optimization, select Conservative.
4. Scroll down.

Eff24892c2d8d85b9bd7a2b402021937.png

- Click Save.

Dddb6e5ebfa9608bc61b3a73517e61f0.png

Task 8-4 - Ping from Spoke VCN to Hub VCN

Now, we have a stable connection from the spokes we can perform some ping tests from the spoke VCN instances.

- Due to routing configuration:

- The traffic will be sent to the DRG.
- The DRG will then route the traffic to the pfSense firewall.
- The pfSense firewall will allow or deny the traffic based on the configured firewall rules.
- When the ICMP traffic is accepted it will route the traffic to the hub-step-stone.

6c1abeb09c33cfe66cc05f7dd0136464.png

1. Do a ping to the hub-step-stone from the spoke A VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

38a6713f09f30fecc3a60b9f5d4722a9.png

1. Do a ping to the hub-step-stone from the spoke B VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

Fef5b3b26f1c6ec38545cd4d98bc5fdf.png

1. Do a ping to the hub-step-stone from the spoke C VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

Cce47137d8b0b1afd1124c180494150e.png

Task 8-5 - Ping from Spoke VCN A to Spoke VCN B

Another ping test we can do is from one spoke to another spoke.

- Due to routing configuration:

- The traffic will be sent to the DRG from spoke VCN A.
- The DRG will then route the traffic to the pfSense firewall.
- The pfSense firewall will allow or deny the traffic based on the configured firewall rules.
- When the ICMP traffic is accepted it will route the traffic back to the DRG - The DRG will route the traffic to spoke VCN B.

C7c5c9855b6e0a88b76e85fed251f092.png

1. Do a ping to spoke B VCN instance from the spoke A VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

Bdc36243e696f845dc9ae9116a778342.png

Task 8-6 - Ping from Spoke VCN to the Internet

Perform some ping tests from the spoke VCN instances towards the internet.

- Due to routing configuration:

- The traffic will be sent to the DRG.
- The DRG will then route the traffic to the pfSense firewall.
- the pfSense firewall will allow or deny the traffic based on the configured firewall rules.
- When the ICMP traffic is accepted it will route the traffic to the NAT gateway.
- The NAT gateway will route the traffic to the internet.

C7780222e4f2b470cfb916ce2bf8cf75.png

1. Do a ping to Google's DNS server `8.8.8.8` from the spoke A VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

Abc67d14d8d765ee90ea2384cddeab84.png

1. Do a ping to Google's DNS server `8.8.8.8` from the spoke B VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

B154fb833b8eee37fc0650db2b0810ec.png

1. Do a ping to Google's DNS server `8.8.8.8` from the spoke C VCN instance.
2. Notice that we have 0% packet loss so the ping is successful.

A649d61b096a4b17eb8adb4bfe326abc.png

Task 8-7 - Connect from Spoke VCN to the Internet

We have done a basic ping test. Now, we need to open up the hub VCN ingress security list to allow all TCP traffic towards the internet because our firewall inspection is done by the pfSense firewall and it does not make sense to have multiple layers of firewall security unless this is the requirement.

Update the Hub VCN Security List

Go to the OCI Console, click Networking and Virtual cloud Networks.

- Click the hub VCN.

F127d64bcbd29b0b3b19615df2caf075.png

1. Click Security Lists.
2. Click the Default Security List for HUB-VCN.

7ca73a554d7684ad570ad05dbd384b36.png

- Click Add Ingress Rules.

291b785c8234dccf784f91a657903c80.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `172.16.1.0/25`.
3. In IP Protocol, select TCP.
4. In Destination Port Range, enter All.
5. Click + Another Ingress Rule.

B3f4401526bba12b72d014703ec9fa25.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `172.16.2.0/25`.
3. In IP Protocol, select TCP.
4. In Destination Port Range, enter All.
5. Click + Another Ingress Rule.

80980211b4d73d887744c27bde73ca9c.png

1. In Source Type, select CIDR.
2. In Source CIDR, enter `172.16.3.0/25`.
3. In IP Protocol, select TCP.
4. In Destination Port Range, enter All.
5. Click + Another Ingress Rule.

6a1186f477893c98e6061f32be987311.png

- Note that all the rules are present.

E669765c7c518b7fcb57515d79642c3d.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

Verify the pfSense Firewall

- To make testing easier we have added a rule to the pfSense firewall to allow all traffic.

3ddb652d252449ac0319ebc3da27b29d.png

- Let us install a simple application on the spoke VCN A instance called Telnet.

1. Run `sudo dnf install telnet` command to install Telnet in the spoke VCN A instance.
2. In Is this ok, enter Y.
3. Notice that the connection is timing out.
4. Click CTRL + C to stop the request.

2a57b5e3b1cd1431010441e6589cf467.png

The software installation and upgrading or a compute instance that is based on Oracle Linux is not done through the Internet.

To install software on an Oracle Linux instance, Oracle only allows to do this from their software repositories and these are reachable using the Service Gateway.

Our next and last task is to create a service gateway and configure routing to route the traffic for the Oracle services through that new service gateway.

Task 8-8 - Allow the Linux Instances to Install and Update Software using the Service Gateway

We have not configured routing for OCI services yet.

- After configuring routing:
- The traffic will be sent to the DRG.
- The DRG will then route the traffic to the service gateway.
- And, the service gateway will route the traffic to the OCI services network.

E75d2883d9c1d547a479b942e3bec0b1.png

- To configure routing, go to the OCI Console, click hamburger menu in the upper left corner, Networking and Virtual cloud Networks.

45682715466ca32f5dc53f07af5a1ef9.png

- Click Hub VCN.

B51d49aa0e0f883430301ca086ca02e8.png

1. Click Service Gateways.
2. Click Create Service Gateway.

5e7a4d1b57526312d7e95a2a34e21a61.png

1. Enter the Name for the service gateway.
2. In Services, select All Services in Oracle Services Network.
3. Click Create Service Gateway.

Bd23754901c7421cd8ba1807c691beb0.png

- Click Close.

B794ee5ea9830ab2c55b5fe2ec0a5a96.png

1. Note that the services gateway is available.
2. Click Route Tables.

Edd034789321d7b0d1dcecfa1726c98d.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Create a route table (`VCN_HUB_RT_SERVICE_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
172.16.1.0/24 Dynamic Routing Gateway DRG Static
172.16.2.0/24 Dynamic Routing Gateway DRG Static
172.16.3.0/24 Dynamic Routing Gateway DRG Static

- Click Create Route Table.

Ce1c8e43ca086460f86e5a820b22ab73.png

1. Enter the Name for the new hub VCN route table for the public subnet.
2. Click + Another Route Rule.

D5c699f276ff8687369edfd503ca1041.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.1.0/24`.
4. Click + Another Route Rule.

981db2417330831bbf736402680c6b7f.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.2.0/24`.
4. Click + Another Route Rule.

7082699a3b10b351b921a6adfda49429.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select CIDR Block.
3. In Destination CIDR Block, enter `172.16.3.0/24`.
4. Click + Another Route Rule.

1f61e1d7d60bae319c91286559686278.png

1. Note that the route table for the services gateway is created. Click the route table name.

90748ff98250fb614480e4689151f94b.png

1. Note all the route rules for the services gateway routing table.
2. Click Hub VCN to return to the Hub VCN page.

Bd52af3fff76704357617005870e33f4.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Now, we have the new VCN route table we need to associate it with the services gateway.

Routing Information: (`VCN_HUB_RT_SERVICE_TRANSIT`) This VCN route table will route traffic that is destined for the spokes to the DRG.

1. Click Services Gateways.
2. Notice that the service gateway does not have any route table associated.
3. Click the three dots.
4. Click Associate Route Table.

47e4a4a3aacd8c2a29661b80419b2232.png

1. Select the VCN route table created earlier: `VCN_HUB_RT_SERVICE_TRANSIT`.
2. Click Associate Route Table.

E4e70f41277fc1c73e0bf0a85904eff7.png

- Note that a new VCN route table is active on the services gateway.

293b2d12d8348655b8338374fb26c75e.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Make sure the DRG also routes the traffic correctly to the new services gateway, we need to update the `VCN_HUB_RT_DRG_TRANSIT` route table.

- Update the route table (`VCN_HUB_RT_DRG_TRANSIT`) in the Hub VCN.

Destination Target Type Target Route Type
0.0.0.0/0 Private IP 172.16.0.20 (FW IP) Static
All FRA Services In Oracle Services Network Service Gateway hub-service-gw Static

1. Click Route Tables.
2. Select the `VCN_HUB_RT_DRG_TRANSIT` route table.

E627467830a5e1e5fccdc8bf47cf5b90.png

- Click Add Route Rules.

1c06ea5c2a1effe4c264c464c40da756.png

1. In Target Type, select Services Gateway.
2. In Destination Service, select All Services in Oracle Services Network.
3. Select the service gateway created above.
4. Click Add Route Rules.

Eaa07a789360e6ebc236789aa4332219.png

1. Note the new route rule we have just created.
2. Click Virtual Cloud Networks to return to the VCN page.

A8f3776a1de61e92ef2a002c264590cc.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Make sure the spoke VCNs also route the traffic correctly to the new services gateway, we need to update the default spoke VCN route tables.

- Update the default VCN routing table in the spoke VCN A.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static
All FRA Services In Oracle Services Network Dynamic Route Gateway DRG Static

- Click spoke A VCN.

F1df6afeff3b5b0b2fb5861d28e75785.png

1. Click Route Tables.
2. Click Default Route Table for SPOKE-VCN-A.

048f242aab1cfd4016781a6c12b1e164.png

- Click Add Route Rules.

9c22dcd427a2cd8f19b620a30adc4ebe.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select Service.
3. In Destination Service, select All Services in Oracle Services Network.
4. Click Add Route Rules.

Fc68600693d46740f8673b71a3aa6fe1.png

1. Note that the OCI services route is now added to the default route table of the spoke VCN A.
2. Click Virtual Cloud Networks to return to the VCN page.

2dcdd19024196391a968227deb4a4b4f.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Update the default VCN routing table in spoke VCN B.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static
All FRA Services In Oracle Services Network Dynamic Route Gateway DRG Static

- Click spoke B VCN.

51b8858ff0b3fb3704610d5f5cbe28db.png

1. Click Route Tables.
2. Click Default Route Table for SPOKE-VCN-B.

Ade6d493156fbf137193d305b808e571.png

- Click Add Route Rules.

53dab47b842ccf51bb468ee423d6ab7d.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select Service.
3. In Destination Service, select All Services in Oracle Services Network.
4. Click Add Route Rules.

664cb55b803b14017f275c378c523f41.png

1. Note that the OCI services route is now added to the default route table of the spoke VCN B.
2. Click Virtual Cloud Networks to return to the VCN page.

172cc12b0fbc1905eea5403caeeba6b5.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Update the default VCN routing table in spoke VCN C.

Destination Target Type Target Route Type
0.0.0.0/0 Dynamic Route Gateway DRG Static
All FRA Services In Oracle Services Network Dynamic Route Gateway DRG Static

- Click spoke C VCN.

64a807acb5a131fd0dd546cb0cceadc6.png

1. Click Route Tables.
2. Click Default Route Table for SPOKE-VCN-C.

44c01e482c223021fec78015687b9cdb.png

- Click Add Route Rules.

2066703a2101d5e3761af20d9149ea9d.png

1. In Target Type, select Dynamic Routing Gateway.
2. In Destination Type, select Service.
3. In Destination Service, select All Services in Oracle Services Network.
4. Click Add Route Rules.

B9013bba754b2b65583b482b863eafeb.png

- Notice that the OCI services route is now added to the default route table of spoke VCN C.

4005d19183fff58020625981420b25a8.png

- The following image illustrates the visual representation of what you have created so far.

Error creating thumbnail: File with dimensions greater than 12.5 MP

- Due to our (services) routing configuration:
- The traffic will be sent to the DRG.
- The DRG will then route the traffic to the service gateway.
- And, the service gateway will route the traffic to the OCI services network.

Note

Our services network traffic is not routed through the pfSense firewall, because the OCI services network is a secured path anyway.

E75d2883d9c1d547a479b942e3bec0b1.png

- Let us install the Telnet application again on the spoke VCN A instance.

1. Run `sudo dnf install telnet` command to install Telnet in the spoke VCN A instance.
2. In Is this ok, enter Y.
3. Note that the installation is Complete!

Ec8365e16566f787c74184ce57ed7ffb.png

1. Run `sudo dnf install telnet` command to install Telnet in the spoke VCN B instance.
2. In Is this ok, enter Y.
3. Note that the installation is Complete!

06bd3a437e15d22418b0f86cfd397aa6.png

1. Run `sudo dnf install telnet` command to install Telnet in the spoke VCN C instance.
2. In Is this ok, enter Y.
3. Note that the installation is Complete!

08d304ac852b89042ec6cd358c958209.png

Network Visualizer

We can use the Network Visualizer tool to get a graphical view of the hub and spoke VCNs with the DRG.

8104e0c9e49c2abc2c5cd5fd088b6eb4.png

Conclusion

In this tutorial, you have learned how to set up a full-blown OCI routing environment with hub and spoke routing fully configured. You have learned how to route all network traffic to the hub VCN where the hub VCN will contain a firewall that will inspect all the traffic coming from the spokes.