NETWORKSTIP Networking CCNA,Centos,Ubuntu,Sql,

Made By Muhammad Nafees

Breaking

Showing posts with label Pfsense. Show all posts
Showing posts with label Pfsense. Show all posts

Tuesday, 19 November 2019

November 19, 2019

Pfsense Traffic Route to specified interface

Pfsense Traffic Route to specified  Interface

  •  1st Go To Firewall >> aliases 
  • Create Aliases list of host



  •  Click On save Aliases is create with name comsat


Now Create a Rule For Traffic Route 

  • Go To firewall >>Rules
  • Now Click On lan >> Then click on add button add New Rules
 
  • Now Check traffic will route from specified interface
November 19, 2019

Pfsene Virtual IP and IP Mapping Multiple Wan Static IP

Pfsene Virtual IP and IP Mapping Multiple Wan Statiac IP

  • 1st Go To Firewall and click on Virtual IP 
  • Then add static ip of wan



  • Now Go To  Firewall then >>Nat


  •  Now Click on 1:1 To create a nat rule to route virtual IP traffic to your local host.




  •  Remaining Settings should be same as i set.
  • Now Rule Will look like this

 


Sunday, 18 November 2018

November 18, 2018

DNS Resolver

DNS Resolver PFSense

  • Open PFSense admin panel Go to Services then Dns resolver
  • Network Interfaces Click on  All
  • Outgoing Network Interfaces Click on All
  • DNS Query Forwarding check

Host Overrides

  • Now in host overrides click on + to add new rule
  • and configure new entry as we configured 


now just test with CMD through nslook command that is this resolving from firewall


Note :In DNS entry primary DNS should be Pfsense

Wednesday, 19 October 2016

October 19, 2016

How to Set Up a Captive Portal Using pfSense

How to Set Up a Captive Portal Using pfSense

PfSense provides an easy way to set up a captive portal for your network. Using the portal allows you to direct the users on your network to a specific web page before they are allowed to access the internet. The web page can be a simple page with instructions and terms of use, or a page that requires a username and password for authentication.
Captive portals are most commonly used for wireless hotspots. If you've ever used the wireless network at a hotel or airport then you have most likely clicked through a portal before you were able to go online. They can also be used on wired connections for business centers, internet Cafés, or your home!
Once the portal has been enabled any computer that points to the pfSense router as the gateway will be automatically redirected to the portal landing page.

Basic Portal Without Authentication

First I'm going to show you how to set up a basic portal without any authentication. Clients connecting to the network will be redirected to an HTML page of your choice. This page can display any message or image that you wish. They must click through the portal by clicking the continue button before they will be granted access to the network.
1. Enable the captive portal - To enable the portal click on captive portal which is found in the services menu of pfSense. Select the check box "Enable captive portal"
2. Select the interface - Most users will select the LAN interface. The captive portal can only run on one interface at a time and pfSense is not able to act as a reverse portal.

Enable the captive portal and select the interface it will run on.
3. Upload a portal page - You must upload an HTML/PHP file to use as a landing page for clients connecting to the portal.
In the section called "Portal page contents" click the "Choose File" button and select the HTML page you want to use. When you are finished click the save button at the bottom of the page to apply the changes.
To verify that your HTML file was successfully uploaded click on the "view current page" button directly below the HTML file upload box.
                                                             Upload an HTML file to serve as the portal page.


4. Testing the Basic Portal - To make sure everything is working simply try to access a webpage from a computer on the network.
If everything is functioning correctly the browser will be redirected to the landing page. Once you click continue the browser should continue to the originally requested URL.
Troubleshooting Tips
  • If the portal page does not load verify the HTML file was uploaded correctly.
  • If the captive portal is running on a VLAN interface make sure the parent VLAN is not assigned to another interface.

                                                                                                                                                                      If the captive portal is working users should be directed to the landing page when they first connect to the internet.

Using Authentication

Another popular reason for using captive portals is to provide a system for authenticating users before they are granted access to the internet.
Users that do not have a valid username and password will not be granted access to the network.
When authentication is enabled users must enter a username and password to access the network.
Local Database vs Radius
The simplest way to set up authentication is to use the local user database on pfSense. If you have a lot of users to manage I would recommend using radius authentication since it is much more flexible.
You can configure the captive portal to point to a remote radius server or you could install the FreeRadius package directly on pfSense. Radius integrates well with existing authentication systems such as active directory, etc.
Initial Setup
To get started follow the steps in the previous section above to enable the captive portal and select an interface.
Modifying the HTML
In order for this to work you will need to use a slightly different HTML landing page that has username and password fields. You can check out my sample HTML page and modify it to suit your needs. Follow the instructions in step 4 of the previous section to upload the page.
For these examples I'm demonstrating pretty basic landing pages but I'll show you how to customize them later.
Enabling Authentication
To enable authentication select either local or radius authentication on the main captive portal settings page. Click on the save button to activate the changes.
Select either local or RADIUS as an authentication type.

Creating Local Users

If you selected local user manager as your method of authentication then you'll need to create some users. If you plan on setting up a large amount of users I would recommend using radius, LDAP, or active directory instead of the local database.
If you don't expect to set up many accounts then this option works well because it's so simple. In some cases you might want to let users share a common username and password, and that's a perfectly valid option too.
To create users in pfSense open the user manager which is found under the system menu. Then simply click on the plus symbol to create a new user.
The pfSense user manager can be used to create local accounts for the captive portal.

Configuring the User Account

To create a simple user you only need to enter a username and password. There are a few other useful options worth checking out though.
Expiration Date - This option allows you to define a date that the account will automatically expire. So if you know the account is temporary this will save you the trouble of having to manually disable the account. If you leave this field blank the account will always be active.
Group Membership - Groups are handy for organizing your users. Groups can be assigned access to administrate certain parts of the pfSense web GUI. For the purposes of the portal groups really aren't that useful.
                   Setting up users is pretty straight forward. You need a username and a password, that's 

Customizing the Portal Page

If you want to make the portal landing page look a bit nicer you can add your own images and custom PHP code.
To upload an image click on the file manager tab in the captive portal settings. In order for files to be used by the portal they must have a prefix of "captiveportal-" in the filename.
You can then reference the files using standard HTML image tags. To see an example download the HTML page with an image link I created.
                      The portal landing page can be customized with images and PHP.

Other settings and Performance Hints

On the main captive portal page there are a number of other settings you can adjust to customize how the portal functions. Below are the descriptions for some of the settings I think are useful.
Idle timeout - If a user is idle for a certain number of minutes they will be automatically disconnected. I recommend setting an idle timeout to keep resources from getting tied up on your pfSense system. You don't want to set the timeout to be too low or your users will be frustrated, even setting it to something like 8 hours will help.
Redirection URL - By default users will continue to the web page they originally requested after passing through the portal. This setting allows you to force clients to be directed to a page of your choice after connecting. Users can then enter a new URL and browse the web normally.
Concurrent user logins - Enabling this setting will allow only one connection to the portal per user. This will prevent users from making multiple connections using the same username and password.

Configure Captive Portal Group settings 
  • Go to the User Manager by navigating to System -> User Manager in the top menu



  • Click on the Group tab to switch to the overview with groups
  • Click on the + icon to create a new group
  • Fill in any name you would like to assign to this group at Group name and click Save at the button to create the new group.

  • After hitting save, you will return to the Group manager page where you should now see your group having been added. Click on the E icon right of the row with your new group to edit the newly created group.
  • You will now notice an extra option is available, compared to seeing this similar screen at step 4 when creating the group, namely Assigned Priviledges. Click on the + icon in this section.
  • In the list with priviledges, select the row stating User - Services - Captive portal login. If this row is not in the list, you most likely haven't enabled the captive portal yet. You need to do this before you can assign rights for it to a group. Hit save at the bottom to add the priviledge to this group
  • You will now see the rights to log in to the captive portal have been added to this group. With the Group Memberships section on this page you can add or remove users to/from this group. Users in this group will be able to log on through the captive portal using their credentials.

Thursday, 22 September 2016

September 22, 2016

Port Forwarding - Step-by-Step Pfsense

CREATE NAT:RULE IN ONE STEP
  • Go to Firewall…NAT.
  • Click the Plus iconon the bottom-right.  
  • Destination type, as far as I can tell, will usually be any.
  • Enter your port(s) alias name in Destination Port Range.
  • Enter your Host alias name in Redirect Target IP.
  • See my example below, and make sure that Add associated filter rule is selected at the bottom before pressing Save and then Apply on the next screen.


Wednesday, 17 February 2016

February 17, 2016

Configure Firewall Rules for Failover in PFSense

Configure Firewall Rules for Failover

Now, here we need to assign firewall rules for failover, To configure firewall rules navigate to “Firewall” and choose “Rules“. Under LAN we have to add new rules for failover.
Click on + Symbol in right side to add new rules.


Make changes to below options.
  1. Interface = LAN
  2. Protocol = any
  3. Source = LAN net
  4. Description = What ever you wish for fail-over.

Under advance settings of Gateway choose WAN1Failover and save, repeat the same instructions to configure WAN2Failover.


Select FailOver Gateway for WAN1
After adding the above rules, you can see the below listed rules for both LoadBalancer and Failover.
Confirm LoadBalancer Failover Rules

Now it’s time to assign at least one DNS server for our Gateway and apply changes and make sure to check the Status of our Gateway.
From “System” Menu choose “General Setup” and check for DNS respectively, which we have assigned under gateway.
Add DNS IP Addresses
Choose “Status” menu and click on “Gateways” to get the status.
Check DNS Status
That’s it we have successfully deployed a Failover in pfsense.

Wednesday, 3 February 2016

February 03, 2016

Pfsense USB Install Guide (Rufus)

Pfsense USB Install Guide (Rufus)


Below we will detail the steps required to create bootable USB installation media for Pfsense.
  1. Download the latest compatible version of pfSense in .img.gz format. Note: the file name should include “memstick”.
  2. Extract the downloaded file to a folder of your choice.
  3. Plug in an empty USB stick and fire up the Rufus.
  4. Select DD Image as bootable disk type (See Image).
  5. Click on the disk icon and browse to the download that was extracted in step 2.
  6. Click “Start” to restore the image onto the USB stick using Rufus (See Image).
  7. Insert the newly created USB stick into router.
  8. Boot into the BIOS of the router and set “USB – HDD” to the top of the boot order. (On Hacom routers, press Del to enter the BIOS).

February 03, 2016

Pfsense complete installation step by step

Choose Installation Type

To install pfSense, first a few decisions are necessary to pick which type of installation will be performed.

64-bit vs 32-bit

pfSense supports both 64-bit (amd64) and 32-bit (i386) architectures. The amd64 platform works on current x86-64 hardware from Intel, AMD, etc. If the hardware is capable of using a 64-bit operating system, then run the amd64 version.
See also:

Full vs Embedded vs LiveCD

The first major decision is whether to use a Full or Embedded installation type. Typically, a Full Install is performed to an SSD or HDD, while Embedded is used for CF/SD/USB media.
An Embedded style installation is geared toward reduced writes on the filesystem, but also cannot run some of the more interesting available packages. A full install may be a little rougher on the target media, but is fully capable of using any packages and other features. See Full Install and NanoBSD Comparison for a more complete list of differences between the two platforms.
A third, much less used type, is running the LiveCD without installing to disk. This type of install does not require an HDD/SSD or CF/SD media, but cannot run any packages. The LiveCD image doubles as an installer for Full Installs. To use the LiveCD, boot the image and configure it without invoking the installer. In this mode, pfSense may also be temporarily tested without otherwise altering the system. The configuration file can be stored on a separate USB stick.

LiveCD vs Memstick vs Memstick Serial

If a Full Install is to be performed, there are three types of install media that can be used to accomplish the task:
  • LiveCD (ISO image, CD/DVD disc): Easy and familiar to many, if the target hardware has an optical drive it's a solid choice, especially if the BIOS will not boot from USB.
  • Memstick: Like the LiveCD, but run from a USB thumb drive. Often faster than the LiveCD. Many new devices do not have integrated optical drives, making this the current best recommendation.
  • Serial Memstick: Like the Memstick image, but runs using the serial console rather than VGA, for newer embedded systems.

NanoBSD vs NanoBSD+VGA

NanoBSD uses the Serial Console by default, so there are two sets of NanoBSD images:
  • NanoBSD: Embedded install type using the serial console by default
  • NanoBSD+VGA: Like NanoBSD, but uses the VGA console instead.

Virtual Machines

Virtual Machines, such as VMware/ESX, should be installed using the ISO image. They can be used to firewall completely inside a hypervisor host for other virtual machines, or for edge filtering/routing tasks.
See Also:

Performing a Full Install (LiveCD, Memstick)


Power on the target system and connect the install media: Place the CD into the drive or plug the Memstick into a USB port. If the BIOS is set to boot from CD/USB, pfSense will start.

For other boot issues, Installation Troubleshooting.

As the operating system boots and pfSense starts, a prompt is presented with some choices and a countdown timer. At this prompt, press i to invoke the installer now.



Alternately, allow the system to boot the rest of the way, assign interfaces, and then choose option 99 to invoke the installer.
The Quick/Easy Install option is, as the name implies, both Quick and Easy. That is the method which will be demonstrated here.
First, the installer console can be changed to use a different font, screenmap, or keymap. Most people do not need to change these, but it may help with some international keyboards.

At the Select Task prompt, choose Quick/Easy Install.

The Quick/Easy Install option assumes the first located disk is the intended target, so be sure there is only one SSD/HDD is present in the system.
NOTE: A GEOM mirror (software RAID) may also be configured by choosing Custom Install and then invoking the option to create the mirror and select the disks. Once that has been completed, then it is possible to return to the Select Task screen and proceed with a Quick/Easy Install
Because the next step is destructive to whatever is currently on the target disk, confirmation is required to proceed. Select OKthen press Enter.
The install will proceed, wiping the target disk and installing pfSense. Copying files may take some time to finish.
After the files have been copied to the target disk, a choice is presented to select the console type. Standard defaults to the VGA console. Embedded defaults to serial console.
Now the system must reboot so that pfSense may start from the target disk. Select Reboot and then press Enter. Be sure to remove the disc or USB memstick so that the system will not attempt to boot from there next time.

After the system reboots, pfSense will be running from the target disk. The next step is to Assign Interfaces on the Console 

Assign interfaces on the Console
he default configuration file on pfSense 2.2 has em0 assigned as WAN, and em1 assigned as LAN. If the target hardware hasem0 and em1, then the assignment prompt is skipped and the install will proceed as usual.
A list of network interfaces and their MAC addresses that were located on the system will appear, along with an indication of their link state if that is supported by the network card. The link state is denoted by "(up)" appearing after the MAC address if a link is detected on that interface. The MAC (Media Access Control) address of a network card is a unique identifier assigned to each card, and no two network cards should have the same MAC address. After that, a prompt will be shown for VLAN configuration.

VLANS

The option to assign VLANs is presented first. If VLANs are not required, or they are not known, enter No here. VLANs are optional and are only needed for advanced networking. VLAN-capable equipment is also required if they are to be used. SeeVLAN Trunking for details.

LAN, WAN, OPTx

The first interface prompt is for the WAN interface. If the interface is known, enter its name, such as igb0 or em0 and pressEnter. If the identity of the card is not known, see the next section for the Auto Assign Procedure.
The second interface prompt is for the LAN interface. Enter the appropriate interface, such as igb1 or em1, and press Enteragain. If only the WAN interface is to be used, and no LAN, press Enter without giving any other input.
Only one interface (WAN) is required to setup pfSense. If more interfaces are available they may be assigned as LAN and OPTx interfaces. The procedure is the same for additional interfaces: Enter the appropriate interface name, then press Enter.
When there are no more interfaces to add, press Enter. The list of assigned interfaces is displayed. If the mappings are correct, enter y, otherwise enter n and repeat the assignment.
NOTE: If only one NIC is assigned (WAN), This is called Appliance Mode. In this mode, pfSense will move the GUI anti-lockout rule to the WAN interface so the firewall may be accessed from there. The usual routing functions would not be active since there is no "internal" interface. This type of configuration is useful for VPN appliances, DNS servers, etc.

Auto Assign Procedure

For automatic interface assignment, first unplug all network cables from the system, then type a and press Enter. Now plug a network cable into the interface that should connect to the WAN, and press Enter. If all went well, pfSense should know now which interface to use for the WAN. The same process may be repeated for the LAN, and any optional interfaces that will be needed. If a message is displayed such as No link-up detected, see Installation Troubleshooting for more information on sorting out network card identities.

Pfsense Default Configuration 
After installation and interface assignment, pfSense has the following default configuration:
  • WAN is configured as an IPv4 DHCP client
  • WAN is configured as an IPv6 DHCP client and will request a prefix delegation
  • LAN is configured with a static IPv4 address of 192.168.1.1/24
  • LAN is configured to use a delegated IPv6 address/prefix obtained by WAN (Track IPv6) if one is available
  • All incoming connections to WAN are blocked
  • All outgoing connections from LAN are allowed
  • NAT is performed on IPv4 traffic leaving WAN from the LAN subnet
  • The firewall will act as an IPv4 DHCP Server
  • The firewall will act as an IPv6 DHCPv6 Server if a prefix delegation was obtained on WAN, and also enables SLAAC
  • The DNS Resolver is enabled so the firewall can accept and respond to DNS queries
  • SSH is disabled.
  • WebGUI is running on port 443 using HTTPS
  • Default credentials are set to a username of admin with password pfsense

Post Install Tasks

After installation and assignment, a shell menu is presented on the console with a number of options. pfSense now is ready to be accessed via the network, either on the LAN interface (if one is assigned), or on the WAN interface in a single interface deployment.

Connect to the GUI

The WebGUI is used to configure the vast majority of items in pfSense. It may be accessed by any modern browser, though Firefox and Chrome are preferred.
Connect a client PC to the LAN of the firewall and ensure it obtained an IP address. If it did not, it may be plugged into the wrong port.
Open a web browser and navigate to https://192.168.1.1/, using the default username admin and password pfsense to login.
The first visit to the WebGUI will be redirected to the setup wizard, which is also accessible at System > Setup Wizard. Proceed through the wizard and configure things as desired.