| 1 | = Pfsense Initial Setup= |
| 2 | |
| 3 | The pfSense project is a free, open source tailored version of FreeBSD for use as a firewall and router with an easy-to-use web interface. There are two ways of installing pfSense. |
| 4 | - Full installation |
| 5 | - Embedded Installation |
| 6 | |
| 7 | Here you are going to create a pfSense virtual machine using full installation method to install pfSense. |
| 8 | |
| 9 | == Setting up virtualbox == |
| 10 | |
| 11 | === Installation of virtualbox and Downloading pfSense iso image === |
| 12 | Download and install virtualbox 5.0.x |
| 13 | |
| 14 | Download pfSense image from the LEARN mirror |
| 15 | |
| 16 | Note down the location of downloaded iso file |
| 17 | |
| 18 | === Creating PFSense VM === |
| 19 | Start virtualbox and Click on New button (at top-right) to create new virtual machine |
| 20 | |
| 21 | Enter name of the VM as: '''ps'your index number'.ws.learn.ac.lk'''. You can get your index number from [wiki:ipallocation here] |
| 22 | |
| 23 | eg: |
| 24 | - ps1.ws.learn.ac.lk |
| 25 | |
| 26 | |
| 27 | Select OS Type: '''BSD''' |
| 28 | |
| 29 | Select Version: '''FreeBSD (64-bit)''' |
| 30 | |
| 31 | Then click on '''Continue''' button |
| 32 | |
| 33 | Set VM's memory size to '''512MB''' and click on Continue button |
| 34 | |
| 35 | Set VM's hard disk option to '''Create a virtual hard disk now''' |
| 36 | |
| 37 | and then click on '''Continue''' |
| 38 | |
| 39 | Select disk type to '''VDI''' |
| 40 | |
| 41 | Select storage type to '''Fixed size''' and '''Continue''' |
| 42 | |
| 43 | Make sure virtual hard disk file name in following format |
| 44 | |
| 45 | '''ps'your index number'.ws.learn.ac.lk''' |
| 46 | |
| 47 | adjust the disk size to '''8.0GB''' |
| 48 | |
| 49 | and click on '''Create''' to create the VM |
| 50 | |
| 51 | This might take couple of minutes |
| 52 | |
| 53 | (Note down the location of vdi image file when virtualbox flashes it on the screen) |
| 54 | |
| 55 | === Setting up Network Interface === |
| 56 | |
| 57 | Select the VM from left panel on Virtual box, right click and open '''Settings''' |
| 58 | |
| 59 | Click on the '''Network''' title |
| 60 | |
| 61 | On '''Adapter 1''' While ''Enable'' Network Adapter selected choose Attached to be '''Bride Adapter'''. This virtual interface will work as the WAN port of the firewall (Can be connect from out side). |
| 62 | |
| 63 | On '''Adapter 2''' While '''Enable''' Network Adapter selected choose Attached to be '''Internal Network'''. Default name is '''intent'''. keep it that way. This virtual interface will work as our LAN port (Can't connect from out side). |
| 64 | |
| 65 | === Setting up boot device and Booting=== |
| 66 | |
| 67 | Click on '''Storage''' title and select '''CD ROM icon''' under the '''Controller:IDEClick''' on CD ROM icon under the '''Attribute''' on the left side to select |
| 68 | |
| 69 | Choose '''Virtual Optical Disk File''' |
| 70 | |
| 71 | Locate the '''PFSense CD image''' file you downloaded from the LEARN ftp |
| 72 | |
| 73 | Right click on VM to make a '''Normal Start''' VM. You should now see a separate window with PFSense Installation screen |
| 74 | |
| 75 | == Pfsense Installation == |
| 76 | |
| 77 | === Initial Installation === |
| 78 | |
| 79 | As the pfSense starts booting, a prompt is displayed with some options and a countdown timer. At this prompt, press '''1''' to get install '''pfsense by default'''. If we don’t choose any option it will start to boot option 1 by default. |
| 80 | |
| 81 | Next, press '''I''' to install fresh copy of pfsense, |
| 82 | |
| 83 | On the next screen, it will ask you to '''Configure Console''', just press '''Accept these settings''' to move forward for installation process. |
| 84 | |
| 85 | Choose '''Quick / Easy Install''' option to take make things easier. Once you are familiar with pfsense installation you can try '''Custom Install'''. |
| 86 | |
| 87 | The install will proceed, wiping the target disk and installing pfSense. Copying files may take some time to finish. |
| 88 | |
| 89 | After the files have been copied to the target disk, a choice is presented to select the '''Console Type'''. Standard Kernel defaults to the VGA console. Embedded Kernel defaults to serial console. Choose '''Standard Kernel''' |
| 90 | |
| 91 | Now the Installation is finished So it will ask to reboot. Choose '''Reboot''' and remember to '''remove the disc''' from vm so it will not fall back to the installation (Some times your vm might hang when you remove your disk. If this happens '''Right click''' your vm ( ps'your index number'.ws.learn.ac.lk) on '''virtualbox manager''' window. Go to the '''close''' attribute and click on '''power off'''. It will shut down your vm. After it shuts down '''Right click''' your vm ( ps'your index number'.ws.learn.ac.lk) on '''virtualbox manager''' window and Click '''start'''. It will start your vm again. |
| 92 | |
| 93 | === First Bootup === |
| 94 | |
| 95 | '''note :''' If you reboot your vm manually you will be prompted straight to the pfSense [#point1 configuration user interface]. But do not worry it will not effect on your firewall |
| 96 | |
| 97 | After rebooting, you will get the a screen with available interfaces to configure the network. |
| 98 | |
| 99 | The first option is presented as '''VLAN’s''', simply here say No by pressing '''n''' and '''enter'''. |
| 100 | |
| 101 | There are two interface’s em0 and em1, pfSense will ask which interface to use as WAN and which interface to use as LAN. Press '''a''' and '''enter''' to auto configure the interfaces. please note that in this case pfSense is intelligent to assign correct virtual interfaces as WAN and LAN ports, Because only one interface can be connect from out side. Even if the interfaces are wrong you can assign them correctly later. |
| 102 | |
| 103 | It will ask for the '''confirmation''' and you can proceed with '''Y''' and press '''enter''' to continue to the |
| 104 | |
| 105 | == [=#point1 pfSense Console Configuration] == |
| 106 | |
| 107 | pfSense console configuration interface has the basic configuration options in pfSense. You can select these options by typing there index number and pressing enter. |
| 108 | |
| 109 | === Assign WAN & LAN Interfaces === |
| 110 | |
| 111 | Note that WAN and LAN Interfaces are assigned by PFSense itself. To change that press '''1''' and '''enter''' |
| 112 | |
| 113 | The first step is presented as '''VLAN’s''', simply here say No by pressing '''n''' and '''enter'''. |
| 114 | |
| 115 | To select em0 as WAN interface type '''em0''' and press '''enter''' |
| 116 | |
| 117 | To select em1 as WAN interface type '''em1''' and press '''enter''' |
| 118 | |
| 119 | We do not need optional interfaces so press '''enter''' at the next step |
| 120 | |
| 121 | Do you want to proceed? press '''y''' to say yes and '''enter''' |
| 122 | |
| 123 | |
| 124 | === Assign WAN IP addresses === |
| 125 | |
| 126 | To change the interface IP address press '''2''' and '''enter''' |
| 127 | |
| 128 | WAN IP is set by DHCP by default. To change the WAN interface IP Address press '''1''' and '''enter'''. |
| 129 | |
| 130 | We are going to have a static IP for WAN Interface. So press '''n''' and '''enter''' to avoid pfSense to configure the interface IP by DHCP. |
| 131 | |
| 132 | Enter the WAN '''IP address assign''' to you and '''enter'''. Give '''subnet mask''' and '''gateway''' in the next steps. You can find your IP allocation fron the [wiki:ipallocation IP table] |
| 133 | |
| 134 | We are going to have an IPv^ address by DHCP. Press '''y''' and '''enter''' to let pfSense get an IPv6 address |
| 135 | |
| 136 | Press '''n''' and '''enter''' to disable http on WAN interface |
| 137 | |
| 138 | You will be promted back to main interface. |
| 139 | |
| 140 | === Assign LAN IP addresses === |
| 141 | |
| 142 | To change the interface IP address press '''2''' and '''enter''' |
| 143 | |
| 144 | To change the WAN interface IP Address press '''2''' and '''enter'''. |
| 145 | |
| 146 | Enter the LAN Ip address as ''' 10.1.1.254'''. Enter subnet mas as '''24'''. We are going to have this IP address as our LAN's gateway IP. Do not give any parameters to gateway on LAN. Just press enter. |
| 147 | |
| 148 | We are not going to have an IPv6 address for LAN. So just Press enter. |
| 149 | |
| 150 | To enable DHCP server on LAN press '''y''' and press enter |
| 151 | |
| 152 | For this workshop our LAN DHCP range is 10.1.1.1 to 10.1.1.50. Give start and end IP addresses in next steps. |
| 153 | |
| 154 | You will be promted back to main interface. |
| 155 | |
| 156 | You have now set up both WAN and LAN IP addresses. |
| 157 | |
| 158 | === Reset WEB Configurator password === |
| 159 | |
| 160 | This step is optional as This step will reveal you the default user name and password for the webconfigurator. Press '''3''' and '''enter'''. |
| 161 | |
| 162 | Above the line 'Do you want to proceed' you will see the default username and password on the web access. Press y or n and enter |
| 163 | |
| 164 | |
| 165 | |
| 166 | |