<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ahmad Afiq Azmi</title>
    <description>The latest articles on DEV Community by Ahmad Afiq Azmi (@froxity).</description>
    <link>https://dev.to/froxity</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F850770%2F883947ad-d5bf-4fc1-9182-d67a6734374c.png</url>
      <title>DEV Community: Ahmad Afiq Azmi</title>
      <link>https://dev.to/froxity</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/froxity"/>
    <language>en</language>
    <item>
      <title>Setup pfSense with TM Unifi [Malaysia ISP]</title>
      <dc:creator>Ahmad Afiq Azmi</dc:creator>
      <pubDate>Thu, 21 Jul 2022 09:31:00 +0000</pubDate>
      <link>https://dev.to/froxity/setup-pfsense-with-tm-unifi-malaysia-isp-ddj</link>
      <guid>https://dev.to/froxity/setup-pfsense-with-tm-unifi-malaysia-isp-ddj</guid>
      <description>&lt;p&gt;Since I learn from my mistake why I was unable to connect my WAN connection to TM Unifi ISP because of 1 tick settings. Here I want to share by default to setup pfSense with TM Unifi.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisite
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;PfSense installed in any hardware. If you do not installed yet, you can check out this &lt;a href="https://docs.netgate.com/pfsense/en/latest/install/install-walkthrough.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; from Netgate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Already go through pfSense wizard initial setup.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configure WAN using PPPoE
&lt;/h2&gt;

&lt;p&gt;Since mostly consumers using TM Unifi will be provided with PPPoE credentials to use connect to Internet. This is configure mostly by their technical staff when we're first installed home fiber at out home.&lt;/p&gt;

&lt;p&gt;Now this is are mostly current architecture for home network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgvktong6ab6twzfobdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgvktong6ab6twzfobdf.png" alt="Network architecture for home"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see above diagram, we want to use pfSense as our main router and firewall and another TM Unifi Router we can use as Access Point.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs47lgca3v8x2no48xged.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs47lgca3v8x2no48xged.png" alt="Network architecture using pfSense"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;:&lt;br&gt;
So the first thing you need to do, go to pfSense WebGUI and login.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;:&lt;br&gt;
Go to Interfaces -&amp;gt; Assignments -&amp;gt; VLANs Tab&lt;/p&gt;

&lt;p&gt;Add new VLAN Tag 500,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: TM Unifi using VLAN 500 for connectivity to Internet and for HyppTV is VLAN 600.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

Parent Interface: &amp;lt;your_WAN_interface&amp;gt;
VLAN tag: 500
VLAN Priority: Blank
Description: TM UNIFI


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: &lt;br&gt;
Go to Interface Assignments Tab, on 'WAN' interface, edit Network port&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

VLAN 500 on &amp;lt;parent interface&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;TM UNIFI&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="c"&gt;# &amp;lt;parent_interface&amp;gt; that you configure on VLAN section.&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;:&lt;br&gt;
Click on 'WAN' Interface&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# General Configuration&lt;/span&gt;

Enable: Yes &lt;span class="c"&gt;# Enable interface&lt;/span&gt;
Description: WAN_TMUNIFI
IPv4 Configuration Type: PPPoE
IPv6 Configuration Type: None
MTU: 1480
MSS: Blank

&lt;span class="c"&gt;# PPPoE Configuration&lt;/span&gt;

&lt;span class="c"&gt;## contact TM Support Center for these details&lt;/span&gt;
Username: &lt;span class="c"&gt;# Your PPPoE username&lt;/span&gt;
Password: &lt;span class="c"&gt;# Your PPPoE Password&lt;/span&gt;
Service name: Blank
Host-Uniq&lt;span class="p"&gt;;&lt;/span&gt; Blank
Dial on demand: Yes &lt;span class="c"&gt;# Enable Dial-On-Demand mode&lt;/span&gt;
Idle &lt;span class="nb"&gt;timeout&lt;/span&gt;: 0
Periodic reset: Disabled

&lt;span class="c"&gt;## Yeah the settings I miss is Dial on demand. We need to enable that for PPPoE connection to work.&lt;/span&gt;

&lt;span class="c"&gt;# Reserved Networks&lt;/span&gt;

Block private networks and loopback addresses: Yes
Block bogon networks: Yes


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and click Save and Apply Changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;:&lt;br&gt;
Verify your PPPoE connections. Go to Status -&amp;gt; Interfaces&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: If you see your static or dynamic public IP address is correct and status and PPPoE is up then you're good. If you're not, ensure VLAN and PPPoE credentials is configure properly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now your PfSense is connected into Internet. Hooray.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure LAN using VLAN
&lt;/h2&gt;

&lt;p&gt;Since, we're now using default TM Unifi Router as Access Points, let's create VLAN for our home network. For this example, we're using VLAN 30.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;:&lt;br&gt;
Go to Interfaces -&amp;gt; Assignments -&amp;gt; VLANs Tab&lt;/p&gt;

&lt;p&gt;Add new VLAN Tag 30,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

Parent Interface: &amp;lt;your_LAN_interface&amp;gt;
VLAN tag: 30
VLAN Priority: Blank
Description: Home Network.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and then click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;:&lt;br&gt;
Go back to Interface Assignments Tab, click &lt;code&gt;+ Add&lt;/code&gt; new Network Port into Interface Assignments.&lt;br&gt;
Choose our VLAN 30 that we've created before. Then click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;:&lt;br&gt;
Go to 'OPT1' or any OPT(ID) that has VLAN 30, configure the interface&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# General Configuration&lt;/span&gt;

Enable: Yes &lt;span class="c"&gt;# Enable interface&lt;/span&gt;
Description: VLAN30
IPv4 Configuration Type: Static IPv4
IPv6 Configuration Type: None
MAC Address: Default
MTU: Blank
MSS: Blank
Speed and Duplex: Default

&lt;span class="c"&gt;# Static IPv4 Configuration&lt;/span&gt;

IPv4 Address: 192.168.30.1/24
IPv4 Upstream gateway: None
&lt;span class="c"&gt;# Note: None - since its on LAN it will use what's on WAN interface gateway.&lt;/span&gt;

&lt;span class="c"&gt;# Reserved Networks:&lt;/span&gt;

Block private networks and loopback addresses: No
Block bogon networks: No


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;and click Save and Apply Changes.&lt;/p&gt;

&lt;p&gt;Good, now you have setup VLAN 30 for your home network and let's create DHCP Server for VLAN 30 for Access Points to distribute automatically IP addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup DHCP Server for VLAN 30
&lt;/h2&gt;

&lt;p&gt;An automatic distribution and assignment of IP addresses, default gateways, and other network characteristics to client devices is performed by a DHCP server, a type of network server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;:&lt;br&gt;
Go to Services -&amp;gt; DHCP Server. Then go to VLAN30 DHCP Server&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;:&lt;br&gt;
Under VLAN30 DHCP Server settings, configure&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# General Options&lt;/span&gt;

Enable: Yes &lt;span class="c"&gt;# Enable DHCP server on VLAN30 interface&lt;/span&gt;
BOOTP: No
Deny unknow clients: Allow all clients
Ignored denied clients: No
Ignore client identifiers: No
Subnet: 192.168.30.0
Subnet mask: 255.255.255.0
Available Range: 192.168.30.1 - 192.168.30.254
Range: 192.168.30.11 - 192.168.30.254
&lt;span class="c"&gt;# Note: Reserved first 10 IP address in the subnet for backup purposes. This IP addresses can be used for static IP for our Access Points or Management Devices.&lt;/span&gt;

&lt;span class="c"&gt;# Additional Pools&lt;/span&gt;
&lt;span class="c"&gt;# - Leave it is as default&lt;/span&gt;

&lt;span class="c"&gt;# Servers&lt;/span&gt;

WINS servers: Default
DNS servers: 
8.8.8.8
1.1.1.1

&lt;span class="c"&gt;# OMAPI&lt;/span&gt;
&lt;span class="c"&gt;# - Leave it is as default&lt;/span&gt;

&lt;span class="c"&gt;# Other Options&lt;/span&gt;

Gateway: 192.168.30.1 &lt;span class="c"&gt;# IP VLAN 30 on LAN interface&lt;/span&gt;
Domain name: Blank
Domain search list: Blank
Domain lease &lt;span class="nb"&gt;time&lt;/span&gt;: Blank
Maximum lease &lt;span class="nb"&gt;time&lt;/span&gt;: Blank
Failover peer IP: Blank
Static ARP: No
Time format change: No
Statistics graphs: No
Ping check: No

&lt;span class="c"&gt;# - Leave it is as default for:&lt;/span&gt;
Dynamic DNS
MAC address control
NTP
TFTP
LDAP
Network Booting
Additional BOOTP/DHCP Options


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;:&lt;br&gt;
Set Firewall Rule for VLAN 30 to able to connect to Internet.&lt;/p&gt;

&lt;p&gt;Go to Firewall -&amp;gt; Rules and choose VLAN 30. Click 'Up Arrow Add' and edit firewall rule&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

Action: Pass
Disabled: No
Interface VLAN30
Address Family: IPv4
Protocol: Any

Source: Any
Destination: Any

Description: Allow INTERNET access


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Rules based on line-by-line configuration. By default, at the end of line, it will be "Deny any any all the rules". This basically block everything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;:&lt;br&gt;
Setup our Access Points with complete SSID and password. This depends on which router model you're using. Go to their model documentation how to set or change your router to access points mode.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Ensure that the Access Points is set Static IP Address. Recommended to use Security WPA/WPA2-Personal&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;:&lt;br&gt;
Test your Internet connection. Connect to your Wi-Fi and ensure you able to ping all of those.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;ping 192.168.30.1 # Your PfSense Router&lt;br&gt;
ping 1.1.1.1&lt;br&gt;
ping 8.8.8.8&lt;br&gt;
ping google.com&lt;br&gt;
ping cloudflare.com&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Congrats, now you've setup basic home network using PfSense. I would love to recommend to check out this Youtube Guy &lt;a href="https://www.youtube.com/channel/UCHkYOD-3fZbuGhwsADBd9ZQ" rel="noopener noreferrer"&gt;Lawrence Systems&lt;/a&gt; for more in depth PfSense configuration and settings.&lt;/p&gt;

</description>
      <category>pfsense</category>
      <category>homelab</category>
    </item>
  </channel>
</rss>
