Monday, July 15, 2013

Cisco SMB: Voice/Data Network on Switches



In this blog I will be explaining how to configure a Cisco SMB Switch with both a Voice and Data VLAN. I will also be going over how to Inter-VLAN route between both the Voice and Data VLANs. Lets start with the hardware I will be using.

Hardware Used:

Cisco SG300 - Firmware 1.3.0.62
Fortinet 50B - Firmware FWF50B-4.00-FW-build656-130211

Lets gather information to get this configuration started:

WAN: 100.50.50.2
Mask: 255.255.255.252
Gateway: 100.50.50.1

VLAN 1
Name: Native
Network: 192.168.5.0 /24
Gateway: 192.168.5.1

VLAN 10
Name: VOICE
Network: 192.168.10.0 /24
Gateway: 192.168.10.1

VLAN 100
Name: MANAGEMENT

Now, lets setup the Fortinet with the default settings of DNS and Default Route.

DNS:

config system dns
    set primary xxx.xxx.xxx.xxx
    set secondary 208.91.112.52

DEFAULT ROUTE:
config router static
    edit 1
        set device "wan1"
        set gateway 100.50.50.1
    next
end

Now we can setup our VLAN and create our default policies.

INTERFACES:

config system interface
    edit "internal"
        set vdom "root"
        set ip 192.168.5.1 255.255.255.0
        set allowaccess ping https ssh http fgfm
        set type physical
    next
    edit "wan1"
        set vdom "root"
        set ip 100.50.50.2 255.255.255.252
        set allowaccess ping fgfm
        set type physical
    next
    edit "VOICE"
        set vdom "root"
        set dhcp-relay-service enable
        set dhcp-relay-ip "192.168.5.5"
        set ip 192.168.10.1 255.255.255.0
        set interface "internal"
        set vlanid 10
    next

FIREWALL POLICIES:
config firewall policy
    edit 1
        set srcintf "internal"
        set dstintf "wan1"
            set srcaddr "all"          
            set dstaddr "all"          
        set action accept
        set schedule "always"
            set service "ANY"          
        set nat enable
    next
    edit 2
        set srcintf "internal"
        set dstintf "VOICE"
            set srcaddr "all"          
            set dstaddr "all"          
        set action accept
        set schedule "always"
            set service "ANY"          
    next
    edit 3
        set srcintf "VOICE"
        set dstintf "internal"
            set srcaddr "all"          
            set dstaddr "all"          
        set action accept
        set schedule "always"
            set service "ANY"          
    next
end

Now we can setup the Cisco SMB Switch.

config-file-header
switch552068
v1.3.0.62 / R750_NIK_1_3_647_260
CLI v1.0
set system mode switch

file SSD indicator plaintext
@
vlan database
vlan 10,100
exit
voice vlan id 10
voice vlan oui-table add 000fd3 Digium
hostname switch552068
!
interface vlan 10
 name VOICE
!
interface vlan 100
 ip address 192.168.100.1 255.255.255.252
 no ip address dhcp
!
interface fastethernet1
 description FORTINET
 switchport trunk allowed vlan add 10
!
interface fastethernet2
 description SWITCHVOX
 switchport mode access
 switchport access vlan 10
!
interface fastethernet12
 description VOICE/DATA
 storm-control broadcast enable
 storm-control broadcast level 10
 storm-control include-multicast
 port security max 10
 port security mode max-addresses
 port security discard trap 60
 spanning-tree portfast
 switchport trunk allowed vlan add 10
 macro description ip_phone
 !next command is internal.
 macro auto smartport dynamic_type ip_phone
!
interface fastethernet48
 description MANAGEMENT
 switchport mode access
 switchport access vlan 100
!
exit

The above is the configuration from the SG300. With this configuration we should be able to daisy chain a computer off a phone and have both on different VLANs. In this setup we used a Digium Switchvox and everything worked out perfectly.






Monday, June 10, 2013

Fortinet: LDAP and IPSec


LDAP Integration and IPSec Configuration

Today I will be explaining the configuration of a FortiGate firewall so network engineers can integrate an LDAP server to a FortiGate device and authenticate users. In this example I will be using a Windows SBS Server and the FortiGate-40C (v5.0,build0179 (GA Patch 2))

First lets gather some information which will help with our configuration.

  • Server IP: 192.168.1.5
  • Server Name: SBS2011
  • Domain Admin (create admin just for FortiGate use): FGadmin
  • Password: Pass1234!

Make a new organizational unit and add all users that you want to authenticate plus the new admin account you created. We can always use an existing group, but make sure the new admin account is present.

Lets run a DNS Query to grab string need for our next step. On your server type the following command in CMD.

dsquery user -name FGadmin

In the following configuration you will drop the string CN=FGadmin,OU=Employees,DC=MyNet,DC=com 
into the set username setting

Lets start the configuration on the FortiGate-40C...

config user ldap
    edit "SBS2011"
        set server "192.168.1.5"
        set cnid "samAccountName"
        set dn "DC=MyNet,DC=com"
        set type regular
        set username "CN=FGadmin,OU=Employees,DC=MyNet,DC=com"
        set password Pass1234
    next
end

Lets test the user...

diag test auth ldap SBS2011 FGadmin Pass1234
authenticate 'FGadmin' against 'SBS2011' succeeded!
Group membership(s) - CN=VPNUsers,OU=Employees,DC=MyNet,DC=com
                                    CN=Domain Users,OU=Employees,DC=MyNet,DC=com

This shows that the Fortinet and the LDAP server are communicating properly. This also shows the groups that the user belongs to. The users should be in the same group as the administrator account.

When adding mutiple users it is easier to go through the GUI and add them. Login to your FortiGate. Navigate to Users, select black arrow next to Create New and select LDAP Users. Select the server you just configured and navigate through tree to the Organization Unit and select users. If users DO NOT show up then we need to make a minor change just for selecting users.

config user ldap
    edit "SBS2011"
        set server "192.168.1.5"
        set cnid "cn"
        set dn "DC=MyNet,DC=com"
        set type regular
        set username "CN=FGadmin,OU=Employees,DC=MyNet,DC=com"
        set password Pass1234
    next
end

Set cnid to cn instead of samAcountName. This option will show users in the tree. I would change this back after adding users so that users can log in with username instead of full name. Example: dlambert instead of Derek Lambert. After that we can add users to a user group. Lets call this group FortiClients.

To create the FortiClients group lets go to Users and Devices, Users, User Group, and click Create New. Name your group, add the users, and add remote authentication server; in this case you should be able to pick the server we created earlier (SBS2011).

We can also add users through the CLI. This is often used when users have a + sign next to their name. Usually some users will have ExchangeActiveSycnh or similar that prevents adding user through the GUI.

config user local
    edit "Derek Lambert"
        set type ldap
        set ldap-server SBS2011
    next
end

config user group
    edit "FortiClients:
        set member "Derek Lambert" "FGadmin"
    next
end

***When adding group members through CLI you must add them all in one single string or for future occasions you can copy the string to notepad add the new users then paste it back into the CLI***

Example:

set member "FGadmin" "Derek Lambert"

After setting members for your user group, here we are using FortiClients, then we can test user authentication through the FortiClient. If you have not setup the Interface VPN then we will need to do this now. Please see my blog on Fortinet: Interface IPsec VPN for Remote Users.

***Please view kb.fortinet.com or docs.fortinet.com since the blog for IPsec VPN for Remote Users has not been written yet.***

Download: http://www.forticlient.com/

If you want to only use the FortiClient with IPsec or SSL you are out of luck unless you can get your hands on, I believe, version 4.3 of the FortiClient. I was able to pull this version from both the FTP site for Fortinet and from the CD that comes with the FortiGate.

DNS Issues

Whenever I ran into DNS issues such as pinging by host name or connecting to mapped drives which have been mapped by host name the following has worked.

config user ldap
    edit "SBS2011"
        set server "192.168.1.5"
        set cnid "samAccountName"
        set dn "DC=MyNet,DC=com"
        set type regular
        set username "CN=FGadmin,OU=Employees,DC=MyNet,DC=com"
        set password Pass1234
    next
end

Change the server setting from the IP address to the host name of the server. Here we will changed "192.168.1.5" to "SBS2011". This is NOT the name of the user ldap setting but the actual name of the server. Here the user ldap and the server are sharing the same exact name.

OR

Make sure the Domain Administrator account, here it is FGadmin, and the user accounts are in the SAME domain user group on the server. We can test this by running the DNS Query on the server.