<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>yurisk.info &#187; Fortigate</title>
	<atom:link href="http://yurisk.info/category/fortigate/feed/" rel="self" type="application/rss+xml" />
	<link>http://yurisk.info</link>
	<description>Technical Blog about IT Security and Networking</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Break free from the GUI dependency – checking Fortigate logs on the cli.</title>
		<link>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/</link>
		<comments>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 19:14:04 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=991</guid>
		<description><![CDATA[Fortinet are doing a lot to keep us away from the command line. And that’s ok in 95% of the cases. But sooner or later you come to meet the 5% of the bad and the ugly when you have no access to the GUI at all. Can you imagine the terror of such situation [...]]]></description>
			<content:encoded><![CDATA[<p>Fortinet are doing a lot to keep us away from the command line. And that’s ok in 95% of the cases. But sooner or later you come to meet the 5% of the bad and the ugly when you have no access to the GUI at all. Can you imagine the terror of such situation ? Fear no more – forewarned is forearmed. Just grab the Fortigate CLI Reference PDF (all in all 754 pages) , learn it by heart then return to my blog . A year has passed quickly, ah ?<br />
Now you are ready for the introduction. One late evening [ and I am sure all security/networking equipment long ago conspired with clients against us to cause troubles at abnormal/non-working hours only] one of the clients asked if I can check something. &#34;No, not something critical but STILL can you check it NOW ..? &#34; , of course ,why not ?<br />
To check something I needed access to the Fortigate logs. All good and well if it were not for the excruciatingly slow connection (in your case it may be blocked GUI management ports, out of band console access, high Fortigate CPU utilization) that made the GUI unusable. As I had not slightest inclination to turn late evening into early morning I did SSH to the machine, run <strong>&#35;show log</strong> and <strong>&#35;get log</strong> commands … and got logging  configuration settings on the firewall.  But where are the logs?<br />
Here&#58;</p>
<div class="cmd">FGT-ugly &#35; execute log display</div>
<p>Hurray ! I got lots of lines running on the terminal, only that it was traffic log and I wanted Event log, and moreover it showed only first 100 lines out of 3400 and I wanted it all. So let’s do it by steps.<br />
Step 1 – know what is served<br />
Run this first to see what you will be presented and what not&#58;</p>
<div class="cmd">FGT-ugly &#35; execute log filter  dump</div>
<div class="cmdout">category&#58; traffic     // each type of log is called category , see later<br />
device&#58; memory     // from where logs are to be read<br />
roll&#58; 0                     // archived version<br />
start-line&#58; 1            // on which line of the logs to start presenting<br />
view-lines&#58; 700      // how many lines to show</div>
<p>Step 2 – I want Event logs now !</p>
<div class="cmd">FGT-ugly&#35; execute log filter  category     //this way you can see all available logs</div>
<div class="cmdout">Available categories&#58;<br />
10&#58; application control<br />
 9&#58; dlp<br />
 6&#58; content<br />
 5&#58; spam<br />
 4&#58; ids<br />
 3&#58; webfilter<br />
 2&#58; virus<br />
 1&#58; event<br />
 0&#58; traffic</div>
<div class="cmd">FGT-ugly&#35; execute log filter  category 1  // switch to Event log </div>
<p>Left is how many lines to show at once .</p>
<div class="cmd">FGT-ugly &#35; execute log filter  view-lines </div>
<p>number    5 – 1000   /// Aha, so we can see maximum 1000 lines per go. Not a problem actually cause every time you hit &#35; execute log display  starting line is increased for the next time by the number of lines shown.<br />
To conclude it all I enabled logging in Putty through which I  connected to the firewall and run </p>
<div class="cmd">FGT-ugly&#35; execute log display</div>
<div class="cmdout">3011 logs found.<br />
1000 logs returned.<br />
1&#58; 2010-07-13 19&#58;10&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=4 msg=&#8221;Performance statistics&#8221;<br />
2&#58; 2010-07-1319&#58;05&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=7 msg=&#8221;Performance statistics&#8221;<br />
3&#58; 2010-07-1319&#58;01&#58;28 log_id=0104032001 type=event subtype=admin vd=root pri=information user=&#8221;admin&#8221; ui=https(21.14.127.14) action=login status=success reason=none profile=&#8221;super_admin&#8221; msg=&#8221;Administrator admin logged in successfully from https(21.14.127.14)&#8221;<br />
4&#58; 2010-07-1319&#58;00&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=5 msg=&#8221;Performance statistics&#8221;<br />
5&#58; 2010-07-1318&#58;55&#58;58 log_id=0143040704 type=event subtype=his-performance pri=information vd=&#8221;root&#8221; action=perf-stats cpu=0 mem=10 total_session=8 msg=&#8221;Performance statistics&#8221;<br />
6&#58; 2010-07-1318&#58;54&#58;09 log_id=0104032003 type=event subtype=admin vd=root pri=information user=&#8221;admin&#8221; ui=https(21.14.127.14) action=logout status=success reason=timeout msg=&#8221;Administrator admin timed out on https</div>
<p>Reference of all log messages known to Fortigate firmware 4 &#58;<br />
<a href="http://docs.fortinet.com/fgt/archives/4.0/techdocs/FortiGate_Log_Message_Reference_01-400-82627-20090528.pdf"> FortiGate_Log_Message_Reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/07/15/break-free-from-the-gui-dependency-checking-fortigate-logs-on-the-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAC finder script</title>
		<link>http://yurisk.info/2010/07/02/mac-finder-script/</link>
		<comments>http://yurisk.info/2010/07/02/mac-finder-script/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 05:35:37 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Esafe]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=959</guid>
		<description><![CDATA[While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this [...]]]></description>
			<content:encoded><![CDATA[<p>While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this router and then search on Google to whom belongs each MAC  if it wasn&#8217;t the subnet mask of /26. Copy pasting each entry of the ARP table into Google didn&#8217;t look like a lot of fun. So I wrote a python script that reads MAC addresses in bulk from command line and using downloaded beforehand database of MAC-vendor translations prints vendor for each MAC address. It works for &#35;show arp on CIsco,&#35;show mac-address-table on CIsco switches, &#35;arp -en  on Linux (means including Checkpoint), &#35;arp -a on Freebsd ,&#35;show arp of Junos from Juniper, &#35;get sys arp on Fortigate.<br />
Below is the script.<br />
Here&#58;<br />
<strong>mac-database.txt</strong> &#8211; file containing MAC-vendor translation in format &lt;MAC 6 hex digits as a sequence&gt; &lt;VENDOR&gt;, I used <a href="http://standards.ieee.org/regauth/oui/oui.txt"> standards.ieee.org/regauth/oui/oui.txt </a> as the source with a bit of sed, but if you want ready to use file I recommend <strong>nmap-mac-prefixes</strong> from nmap source-code distribution <a href="http://nmap.org/svn/nmap-mac-prefixes">http://nmap.org/svn/nmap-mac-prefixes</a><br />
Download script (to make sure formatting is preserved, an important thing for Python)<br />
<a href="http://yurisk.info/scripts/mac-finder.py">http://yurisk.info/scripts/mac-finder.py</a><br />Script AND mac database from nmap project &#8211; <a href="http://yurisk.info/scripts/mac.tar.gz"> http://yurisk.info/scripts/mac.tar.gz</a></p>
<div class="cmdout">
<pre>
&#35;!/usr/bin/python
&#35;This script accepts MAC addresses from the command line and
&#35;prints vendor for each mac address
&#35; Author&#58;Yuri, yurisk@yurisk.info,06.2010
import sys
import re
&#35;This function removes from MACs colon or dot and returns MAC as a sequence of HEX chars
def dotreplace(matchobj):
&nbsp;&nbsp;       if matchobj.group(0) == &#39;.&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&nbsp;&nbsp;       elif  matchobj.group(0) == &#39;&#58;&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&#35;open file with MAC addresses and vendors database,it has form xxxx &lt;Vendor&gt;
macs=open(&#39;mac-database.txt&#39;,&#39;r&#39;)
macs_lines=macs.readlines()
&#35;Read from stdinput
data = sys.stdin.readlines()
for ppp in data:
       popa=re.search(&#39;.*([a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}).*&#39;,ppp,re.IGNORECASE)
       if popa:
             newpopa=re.sub(&#39;\.&#39;, dotreplace,popa.group(1))[0:6]
             newpopa_re=re.compile(newpopa,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopa_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
       popalinux = re.search(&#39;.*([a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}).*&#39;,ppp,re.IGNORECASE)
       if popalinux&#58;
             newpopalinux=re.sub(&#39;&#58;&#39;,dotreplace,popalinux.group(1))[0&#58;6]
             newpopalinux_re=re.compile(newpopalinux,re.IGNORECASE)
             for mac_db in macs_lines&#58;
                 vendor=re.search(newpopalinux_re,mac_db)
                 if vendor&#58;
                    print ppp.strip(),mac_db[7&#58;]

       popadash = re.search('.*([a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}).*',ppp,re.IGNORECASE)
       if popadash:
             newpopadash=re.sub('-',dotreplace,popadash.group(1))[0:6]
             newpopadash_re=re.compile(newpopadash,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopadash_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
</pre>
</div>
<p>Running it:</p>
<div class="cmd">
[root@darkstar ]# ./mac-finder.py</div>
<div class="cmdout">
&lt;now I copy paste output from arp -a in BSD&gt;<br />$ arp -a<br />
(10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet]<br />
 (10.99.99.254) at 00:09:0f:31:c8:24  on em0 [ethernet]<br /> &lt;Hit CTRL+D to signal the end of input&gt;<br />
 (10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet] VMware, Inc.<br />
 (10.99.99.254) at 00:09:0f:31:c8:24 on em0 [ethernet] Fortinet Inc.</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/07/02/mac-finder-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visio stencils for Cisco, Juniper, Fortinet, Checkpoint, Avaya</title>
		<link>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/</link>
		<comments>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 12:43:25 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=942</guid>
		<description><![CDATA[Some links to download Visio stencils of the few most popular vendors.
Juniper
Cisco
Avaya
BlueCoat
 Fortinet
DellCheckpoint happen not to have official stencils set, only Nokia appliances stuff can be found. So someone volunteered and using icons/press releases/PowerPoint presentations done by the Checkpoint turned it into the Visio stencils&#58;
fireverse.orgIf nothing  else helps here you  can find the [...]]]></description>
			<content:encoded><![CDATA[<p>Some links to download Visio stencils of the few most popular vendors.<br />
<a href="http://www.juniper.net/us/en/products-services/icons-stencils/">Juniper</a><br />
<a href="http://www.cisco.com/en/US/products/prod_visio_icon_list.html">Cisco</a><br />
<a href="http://support.avaya.com/css/appmanager/public/support?_nfpb=true&#038;_pageLabel=WNContent_Public&#038;contentid=C20097681410857094">Avaya</a><br />
<a href="http://www.bluecoat.com/resources/productimageslogos">BlueCoat</a><br />
<a href="http://kb.fortinet.com/kb/microsites/search.do?cmd=displayKC&#038;docType=kc&#038;externalId=11091&#038;sliceId=1&#038;docTypeID=DT_KCARTICLE_1_1&#038;dialogID=7440262&#038;stateId=0%200%207442231"> Fortinet</a><br />
<a href="http://www.dell.com/content/topics/topic.aspx/global/products/pvaul/topics/en/visio?c=us&#038;l=en&#038;s=gen">Dell</a><br />Checkpoint happen not to have official stencils set, only Nokia appliances stuff can be found. So someone volunteered and using icons/press releases/PowerPoint presentations done by the Checkpoint turned it into the Visio stencils&#58;<br />
<a href="http://fireverse.org/?page_id=14">fireverse.org</a><br />If nothing  else helps here you  can find the rest&#58;<br />
<a href="http://nag.ru/projects/visio/">nag.ru/projects/visio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/26/visio-stencils-for-cisco-juniper-fortinet-checkpoint-avaya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fortigate BGP &#8211; configure and debug</title>
		<link>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/</link>
		<comments>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:56:12 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=647</guid>
		<description><![CDATA[Everyone today speaks BGP: Cisco routers, Juniper routers and ScreenOS firewalls, Fortigate does it,even SonicWall  have it  as planned feature  So question is not whether but how. The opportunity to see how it works on Fortigate recently presented itself and here is the sum up of how I configured and debugged Fortigate [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone today speaks BGP: Cisco routers, Juniper routers and ScreenOS firewalls, Fortigate does it,even SonicWall  have it  as planned feature  So question is not whether but how. The opportunity to see how it works on Fortigate recently presented itself and here is the sum up of how I configured and debugged Fortigate BGP set up.<br />
Task at hand: configure BGP peering with Bogon Route project by Team Cymru <a href="http://www.team-cymru.org/Services/Bogons/routeserver.html"> www.team-cymru.org/Services/Bogons/routeserver.html </a> . More information about the Bogon Routes can be found at the source &#8211; <a href="http://www.team-cymru.org/Services/Bogons/">www.team-cymru.org/Services/Bogons </a>. But in few words they advertise to you routes that are never to be seen in your network for legitimate reasons. Those are networks not only from RFC 1918 but those reserved by RIPE for special purposes, and those unallocated to anyone as of now.<br />
 What we need to know for this set up is this:</p>
<ul>
<li>They advertise all the networks with no-export community</li>
<li>also they attach 65333:888  community (as per their site)</li>
<li>they use md5 password authentication </li>
<li>they don&#8217;t expect you to advertise to them anything</li>
<li>in advertised networks next hop is their advertising router </li>
<li>their AS number is 65333</li>
</ul>
<p>Based on all the above my Fortigate BGP peer had to :</p>
<ul>
<li>enable multihop peering</li>
<li>use MD5 password authentication</li>
<li>have route-map to attach no-export community so that we don&#8217;t  inadvertently advertise learned routes to other peers ( just safety net , in case BGP peer stops attaching no-export community to their routes) </li>
<li>set next hop for the learned routes to Null 0 interface.</li>
</ul>
<p>Let&#8217;s start configuring something. Important surprise here – in Fortigate GUI you can only set  3 parameters:<br />
<i>As number , Peer Ip</i> and <i>networks</i> to be advertised, the rest is to be done on the  command line . So here it goes<br />
1) Configuring route-map to set no-export community on learned networks and force next hop to be some reserved Ip (192.0.2.1 )  that in turn is statically routed to Null interface ,</p>
<div class="cmd">config router route-map<br />
    edit &#8220;NO-EXPORT&#8221;<br />
            config rule<br />
                edit 3<br />
                    set set-community &#8220;no-advertise&#8221;<br />
                    set set-ip-nexthop 192.0.2.1<br />
                next<br />
            end<br />
    next<br />
End </div>
<p>2) Configure BGP peer</p>
<div class="cmd">(root) # show router bgp<br />
config router bgp<br />
    set as 65002<br />
        config neighbor<br />
            edit 84.22.96.5<br />
                set ebgp-enforce-multihop enable<br />
                set remote-as 65333<br />
                set route-map-in &#8220;NO-EXPORT&#8221;<br />
                set password &#8220;yuiyui&#8221;<br />
            next<br />
        end<br />
        config redistribute &#8220;connected&#8221;<br />
            set status enable<br />
        end</div>
<p>3) Configure static blackhole route for the reserved IP used as the next hop for this.</p>
<div class="cmd">(root) # sh router static<br />
config router static<br />
        edit 3<br />
        set blackhole enable<br />
        set dst 192.0.2.1 255.255.255.255<br />
    next<br />
End</div>
<p>Validation phase.<br />
All configs are as good as the prove that it works.</p>
<p> List shortly all the peers </p>
<div class="cmd">(root) # get router info bgp summary</div>
<pre>BGP router identifier 10.250.250.2, local AS number 65002
BGP table version is 159
2 BGP AS-PATH entries
0 BGP community entries

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
84.22.96.5   4  65333       4       6      159    0    0 00:00:48        0

Total number of neighbors 1 </pre>
<p>List all BGP neighbors and their peering state</p>
<div class="cmd">My-FG (root) # get router info bgp neighbors</div>
<pre>
BGP neighbor is 84.22.96.5, remote AS 65333, local AS 65002, external link
  BGP version 4, remote router ID 84.22.96.5
  BGP state = Established, up for 00:00:58
  Last read 00:00:58, hold time is 180, keepalive interval is 60 seconds
  Configured hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received (old and new)
    Address family IPv4 Unicast: advertised and received
  Received 4 messages, 0 notifications, 0 in queue
  Sent 6 messages, 0 notifications, 0 in queue
  Route refresh request: received 0, sent 0
  Minimum time between advertisement runs is 30 seconds

 For address family: IPv4 Unicast
  BGP table version 160, neighbor version 159
  Index 3, Offset 0, Mask 0x8
  Community attribute sent to this neighbor (both)
  Inbound path policy configured
  Route map for incoming advertisements is *NO-EXPORT
  0 accepted prefixes
  19 announced prefixes
  Connections established 1; dropped 0
  External BGP neighbor may be up to 255 hops away.
Local host: 10.250.250.2, Local port: 9188
Foreign host: 84.22.96.5, Foreign port: 179
Nexthop: 10.250.250.1</pre>
<p> See the routes learned through the BGP protocol</p>
<div class="cmd">(root) #  get router info bgp network</div>
<pre>
BGP table version is 161, local router ID is 10.250.250.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 5.0.0.0          192.0.2.1                0             0 65333 65333 i
*> 14.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 23.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 31.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 36.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 37.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 39.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 42.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 49.0.0.0         192.0.2.1                0             0 65333 65333 i
*> 100.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 101.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 102.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 103.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 104.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 105.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 106.0.0.0        192.0.2.1                0             0 65333 65333 i
*> 169.254.0.0      192.0.2.1                0             0 65333 65333 i
*> 172.16.0.0/12    192.0.2.1                0             0 65333 65333 i
*> 176.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 177.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 179.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 181.0.0.0/8      192.0.2.1                0             0 65333 65333 i
*> 185.0.0.0/8      192.0.2.1                0             0 65333 65333 i
 </pre>
<p>List routes that are currently installed in the routing table that were learned by BGP .</p>
<div class="cmd">(root) # get router info routing-table bgp</div>
<pre>
B       5.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       14.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       23.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       31.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       36.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       37.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       39.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
B       42.0.0.0/8 [20/0] via 192.0.2.1 (recursive is directly connected, unknown), 00:00:19
</pre>
<p>After all is configured and saved (and probably doesn&#8217;t work) comes the bgp debug round.<br />
Enable bgp debug on the appliance</p>
<div class="cmd">#diag ip router bgp all enable</div>
<p>Enable debug output to console</p>
<div class="cmd">diag debug enable</div>
<p>To stop this output </p>
<div class="cmd">diagnose  debug disable</div>
<p>To verify that debug is on</p>
<div class="cmd"># diag ip router bgp show</div>
<pre>BGP debugging status:
  BGP events debugging is on
  BGP debug level: INFO </pre>
<p>If nothing after that happens try clearing all BGP sessions</p>
<div class="cmd">#exec router clear bgp all</div>
<p>The good way to judge something new is to compare it with something you already know. To continue<br />
With that logic I cross-reference debug output seen on Fortigate with the one seen on the Cisco BGP peer. That<br />
way you  can decide what is more informative and who wins the race (Cisco of course, what you thought?). </p>
<p> <strong>Case 1</strong><br />
<u>One of the peers is configured with wrong AS number.</u><br />
In Fortigate you see this:</p>
<pre>BGP: 84.22.96.5-Outgoing [FSM] State: Idle Event: 3
BGP: 84.22.96.5-Outgoing [NETWORK] FD=15, Sock Status: 0-Success
BGP: 84.22.96.5-Outgoing [FSM] State: Connect Event: 17
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 1
BGP: 84.22.96.5-Outgoing [ENCODE] Open: Ver 4 MyAS 65002 Holdtime 180
BGP: 84.22.96.5-Outgoing [ENCODE] Open: Msg-Size 45
BGP: 84.22.96.5-Outgoing [DECODE] Msg-Hdr: type 3, length 23
BGP: %BGP-3-NOTIFICATION: received from 84.22.96.5 2/2 (OPEN Message Error/Bad Peer AS.) 2 data-bytes
</pre>
<p>Now let&#8217;s compare to the debug from Cisco</p>
<div class="cmd">#debug ip bgp events  </div>
<pre>
Mar 24 13:14:55.572: %BGP-3-NOTIFICATION: sent to neighbor 10.250.250.2 2/2 (peer in wrong AS) 2 bytes FDEA FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 002D 0104 FAEA 01B4 0AFA EA02 1302 0201 1400 0100 0132 0222 0012 0222 00
</pre>
<p><strong>Case 2</strong><br />
<u>MD5 authentication is set on Cisco but not on the Fortigate.</u> Again for comparison<br />
debug from Fortigate and debug from Cisco<br />
Cisco:</p>
<pre>Jan  5 10:42:14.299: %TCP-6-BADAUTH: No MD5 digest from 10.250.250.2 (1037) to 84.22.96.5(179)</pre>
<p>Fortigate:</p>
<pre>
84.22.96.5-Outgoing [FSM] State: Connect Event: 9
BGP: [RIB] Scanning BGP Network Routes...
84.22.96.5-Outgoing [FSM] State: Connect Event: 9
BGP: [RIB] Scanning BGP Network Routes...
</pre>
<p><strong>Case 3 </strong><u> (that actually happened when I configured this Fortigate) is mismatched MD5 password on either side</u></p>
<p>Fortigate:<br />
Doing summary listing showed peering as down :</p>
<pre>84.22.96.5   4  65333     934    1036        0    0    0    never Connect </pre>
<p>Cisco:</p>
<pre>*Mar 24 13:40:28.800: BGP: Regular scanner event timer
*Mar 24 13:40:28.800: BGP: Import timer expired. Walking from 1 to 1
*Mar 24 13:40:42.764: %TCP-6-BADAUTH: Invalid MD5 digest from 10.250.250.2(11064) to 84.22.96.5(179)
 </pre>
<p> <strong>Case 4 </strong><u>On Cisco ttl-security is enabled while on Forigate ebgp multi-hop is not .</u><br />
There is no such thing as TTL security on the Fortigate by the way, all you can do to handle this state is enable ebgp-multihop and them it starts sending BGP packets with ttl = 255 .</p>
<p>Cisco:</p>
<pre>Jan  7 13:01:36.992: %BGP-4-INCORRECT_TTL: Discarded message with TTL 2 from 10.250.250.2</pre>
<p> Forigate:</p>
<pre>
BGP: 84.22.96.5-Outgoing [FSM] State: OpenConfirm Event: 11
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 4
BGP: 84.22.96.5-Outgoing [ENCODE] Keepalive: 13548 KAlive msg(s) sent
84.22.96.5-Outgoing [FSM] State: OpenConfirm Event: 10
BGP: 84.22.96.5-Outgoing [ENCODE] Msg-Hdr: Type 3
BGP: %BGP-3-NOTIFICATION: sending to 84.22.96.5 4/0 (Hold Timer Expired/Unspecified Error Subcode) 0 data-bytes
BGP: 84.22.96.5-Outgoing [FSM] State: Idle Event: 3
BGP: 84.22.96.5-Outgoing [NETWORK] FD=14, Sock Status: 111-Connection refused
BGP: 84.22.96.5-Outgoing [FSM] State: Connect Event: 18
</pre>
<p> <strong>Bonus Case </strong> Bug-not-a-feature thing on the Fortigate – when configuring MD5 password for  BGP authentication you get Cross-Site vulnerability protection for free <img src='http://yurisk.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Don&#8217;t ask  me how XSS is connected to cli configuration of BGP …</p>
<div class="cmd"> set password  &lt;2AEARep&gt;</div>
<p><span class="cmdout">The string contains XSS vulnerability characters<br />
value parse error before &#8221;<br />
Command fail. Return code -173</span></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/03/26/fortigate-bgp-configure-and-debug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Difference between ebgp-multihop and ttl-security.</title>
		<link>http://yurisk.info/2010/02/26/difference-between-ebgp-multihop-and-ttl-security/</link>
		<comments>http://yurisk.info/2010/02/26/difference-between-ebgp-multihop-and-ttl-security/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 18:39:12 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[IOS Cisco]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=512</guid>
		<description><![CDATA[Once upon a time reading some CCIE paper at work I asked myself a question : “Why would someone bother to invent ttl-security and even write RFC http://tools.ietf.org/html/rfc5082 on it when multi-hop EBGP feature provides the same end result ?” .
The results of my busy/doing-nothing activity I present here.First some background. For some (unknown to [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time reading some CCIE paper at work I asked myself a question : “Why would someone bother to invent ttl-security and even write RFC http://tools.ietf.org/html/rfc5082 on it when multi-hop EBGP feature provides the same end result ?” .<br />
The results of my busy/doing-nothing activity I present here.<br />First some background. For some (unknown to me) reasons BGP peering was envisioned as TCP connection between directly connected routers, by default. To proceed with this design (worth checking BGP RFCs if it was actually an obligation)  vendors (Cisco,Juniper and even Fortinet) implemented all BGP protocol communication using  TTL=1 in TCP packets being exchanged. As the logical consequence of this if a router was placed more than 1 hop away from its peer  BGP session could  not be established. To provide for such set ups when peers are many hops away the ebgp-multihop term was coined – on configuration level you can specify that BGP peer is that hops far away . <br />What happens in fact is that when you specify such multi-hop BGP peer the router starts sending BGP packets with TTL being equal to the number of hops you set . That means if I set peer to be 3 hops away and some attacker tries to spoof legit peer’s IP but is 4 hops away – such attack won’t succeed cause my router will receive spoofed BGP packets ok but will send replies with TTL of 3 which will expire just 1 hop away from the attacker.<br />
Questionable , but security .  So why ttl security?<br />
This feature indeed enforces that BGP peer is no more than given hops away . And here comes the difference – it enforces it inbound . It works this way – after you enable ttl security on the BGP peer session and specify how many hops away this peer is allowed to be, your router<br />
checks incoming TCP packets from this peer and does this simple calculation &#59; configured value &lt;= 255 – hops-away-to-peer , if it holds true your router goes on with establishing BGP session , if not – session is shut down. Regarding outgoing TTL values – may be it is Cisco-only thing, may be not , but the moment you enable ttl security for some BGP peer on Cisco the router itself starts sending BGP-related packets to this peer with initial ttl being equal to 255. I guess it is logical that if you enforce on your side ttl security the peering side will want to do the same.<br />
<br />When ttl rule is broken we see in the debug session:<br />
Dec 27 19:08:04.103: %BGP-4-INCORRECT_TTL: Discarded message with TTL 1 from 124.2.11.15<br />
And neighbor status is:<br />
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd<br />
124.2.11.15   4 13462      33      63        0    0    0 00:04:31 Idle</p>
<p>#sh ip bgp neighbors 124.2.11.15<br />
BGP neighbor is 124.2.11.15,  remote AS 13462, external link<br />
  BGP version 4, remote router ID 0.0.0.0<br />
  BGP state = Closing</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/02/26/difference-between-ebgp-multihop-and-ttl-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fortigate firewall demo  free access. Also FortiManager and FortiAnalyzer</title>
		<link>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/</link>
		<comments>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:37:25 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=488</guid>
		<description><![CDATA[As someone said best things in life are free.
Here are links to the demo Forigate firewall, ForiAnalyzer and FortiManager open to access from anywhere . So that you can
familiarize yourself with the Management GUI look and feel.
NOTE: Access is read-only.
NOTE 2: No , it is not me being so generous, it&#8217;s Fortinet caring for us.
Fortigate [...]]]></description>
			<content:encoded><![CDATA[<p>As someone said best things in life are free.<br />
Here are links to the demo Forigate firewall, ForiAnalyzer and FortiManager open to access from anywhere . So that you can<br />
familiarize yourself with the Management GUI look and feel.<br />
NOTE: Access is read-only.<br />
NOTE 2: No , it is not me being so generous, it&#8217;s Fortinet caring for us.<br />
<strong>Fortigate 300 :</strong><br />
user:demo<br />
password: fortigate<br />
<a href="https://fortigate.com"> fortigate.com</a><br />
<strong>ForiAnalyzer 800:</strong><br />
user:demo<br />
password: fortianalyzer<br />
<a href="https://www.fortianalyzer.com">fortianalyzer.com </a><br />
<strong>FortiManager 400:</strong><br />
user:demo<br />
password: fortimanager<br />
<a href="https://www.fortimanager.com">fortimanager.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/02/03/fortigate-firewall-demo-free-access-also-fortimanager-and-fortianalyzer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scheduled Daily Reboot of FortiGate</title>
		<link>http://yurisk.info/2010/01/19/scheduleddaily-reboot-of-fortigate/</link>
		<comments>http://yurisk.info/2010/01/19/scheduleddaily-reboot-of-fortigate/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 07:43:54 +0000</pubDate>
		<dc:creator>Chen</dc:creator>
				<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=402</guid>
		<description><![CDATA[Recently I had to do late night restart of a Fortigate and  was looking for &#8220;Reload in&#8230;&#8221;
I found it, but in Fortigate it is a little different.
It&#8217;s called Daily Restart, and  if you want to use it once you need to remember to remove this command.
 config system global
set daily-restart enable
set restart time [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to do late night restart of a Fortigate and  was looking for &#8220;Reload in&#8230;&#8221;<br />
I found it, but in Fortigate it is a little different.<br />
It&#8217;s called <strong>Daily Restart</strong>, and <u><font color="#FF0000"> if you want to use it once you need to remember to remove this command.</font></u></p>
<div class="cmd"> config system global<br />
set daily-restart enable<br />
set restart time 04:00<br />
end</div>
<p>Now the FortiGate is configured to reboot at 4 AM (System Time).<br />
Don&#8217;t forget to update the system clock (Use NTP, Always keeps it synced)</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/01/19/scheduleddaily-reboot-of-fortigate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Failed to connect to Fortiguard servers</title>
		<link>http://yurisk.info/2009/06/19/failed-to-connect-to-fortiguard-servers/</link>
		<comments>http://yurisk.info/2009/06/19/failed-to-connect-to-fortiguard-servers/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:44:49 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=176</guid>
		<description><![CDATA[Today encountered otherwise easy to diagnose misconfiguration  only that Fortinet decided to &#8216;hide&#8217; this parameter deep enough  so that it got on my nerves until I fixed it.
NOTE : Fortiguard is subscription based service when your Fortigate unit periodically
connects to the Fortinet servers (collectively named Fortiguard servers) to get info that enables advanced
feautures [...]]]></description>
			<content:encoded><![CDATA[<p>Today encountered otherwise easy to diagnose misconfiguration  only that Fortinet decided to &#8216;hide&#8217; this parameter deep enough  so that it got on my nerves until I fixed it.</p>
<blockquote><p>NOTE : Fortiguard is subscription based service when your Fortigate unit periodically<br />
connects to the Fortinet servers (collectively named Fortiguard servers) to get info that enables advanced<br />
feautures like filtering by category/rating.</p></blockquote>
<p>Problem &#8211; suddenly Fortigate of the client refused to do web/spamfiltering service while having valid contract subscription. Not a big deal as in System -&gt;  Maintenance -&gt; Fortiguard status was &#8220;Failed to connect &#8221; (or something of a kind dont recall it now) . On the same page there is a nice button &#8220;Test Availability&#8221;   pushing which would bring error &#8220;Connection failed Check firewall routing table&#8221; .<br />
In most of the cases it is either reachability issue or Fortigate is trying  to update against wrong server.<br />
Doing pings successfuly from the firewall to service.fortiguard.net  (FQDN to use for Fortiguard servers)<br />
left 2nd option  &#8211; wrong Fortiguard server hardcoded somewhere in the configs. Doing<br />
<strong>FG100 # show system fortiguard</strong>   Gave only this<br />
config system fortiguard<br />
    set antispam-cache disable<br />
    set webfilter-cache disable<br />
end</p>
<p>And only doing <strong>FG100 # get system fortiguard </strong>  Gave the answer<br />
hostname            : 66.92.33.1<br />
srv-ovrd            : disable<br />
port                : 53<br />
client-override-status: disable</p>
<p>To fix this you enter:<br />
<strong>FG100 # config  system fortiguard</strong><br />
<strong>FG100 (fortiguard) # set </strong><br />
*hostname                    hostname or IP of the FortiGuard server<br />
<strong>FG100 (fortiguard) # set  service.fortiguard.net</strong><br />
FG100 (fortiguard) #next</p>
<p>* FortiOS 3.x uses service.fortiguard.net , FortiOS 2.80 used  guard.fortinet.net  for Webfiltering and<br />
antispam.fortigate.com for Antispam filtering and it is Fortinet recommendation to do so, nevertheless<br />
setting guard.fortinet.net in Fortios 3 works as well (after all they are CNAME&#8217;d )</p>
<p>And while we are on it, here are few useful debug commands for the topic:</p>
<p> &#8211; To see real time list of servers to which the firewall tries to connect for Fortiguard service<br />
<strong>FG200# diagnose debug rating</strong><br />
Locale       : english<br />
License      : Contract<br />
Expiration   : Fri Jun 17 02:00:00 2010<br />
Hostname     : guard.fortinet.net</p>
<p>-=- Server List (Wed Jun 19 08:12:58 2009) -=-</p>
<p>IP                  Weight Round-time  TZ    Packets  Curr Lost Total Lost<br />
212.95.252.121           0         85   0     521863          0        113<br />
212.95.252.120           0         89   0       4625          0          5<br />
82.71.226.65             0         97   0       2140          0         34<br />
62.209.40.73            10        105   1       2060          0          0<br />
62.209.40.72            10        103   1       2060          0          0<br />
66.117.56.37            50        158  -5       2060          0          0<br />
69.20.236.180           50        191  -5       2060          0          0<br />
69.20.236.179           50        185  -5       2060          0          0<br />
66.117.56.42            50        164  -5       2061          0          1<br />
72.52.72.243            80        245  -8       2063          0          3<br />
116.58.208.39           80        371  -8       2081          0         21<br />
208.91.112.194          80        233  -8       2075          0         12<br />
216.156.209.26          80        239  -8       2068          0          7<br />
121.111.236.179         90        354   9       2061          0          1<br />
121.111.236.180         90        366   9       2064          0          4</p>
<p> &#8211; The same for Antispam service<br />
<strong>FG200# diagnose spamfilter fortishield servers</strong><br />
Locale       : english<br />
License      : Contract<br />
Expiration   :Fri Jun 17 02:00:00 2010<br />
Hostname     : guard.fortinet.net</p>
<p>-=- Server List (Wed Jun 19 08:13:39 2009) -=-</p>
<p>IP                  Weight Round-time  TZ    Packets  Curr Lost Total Lost<br />
212.95.252.121           0         94   0       2063          0          0<br />
212.95.252.120           0         96   0       2061          0          0<br />
82.71.226.65             0        104   0       2076          0         18<br />
62.209.40.73            10        113   1       2061          0          0<br />
62.209.40.72            10        111   1       2061          0          0<br />
66.117.56.37            50        159  -5       2061          0          0<br />
69.20.236.180           50        199  -5       2061          0          0<br />
69.20.236.179           50        193  -5       2061          0          0<br />
66.117.56.42            50        169  -5       2063          0          2<br />
72.52.72.243            80        273  -8       2065          0          4<br />
116.58.208.39           80        380  -8       2085          0         24<br />
208.91.112.194          80        271  -8       2071          0          8<br />
216.156.209.26          80        261  -8       2064          0          2<br />
121.111.236.179         90        362   9       2061          0          0<br />
121.111.236.180         90        370   9       2062          0          1</p>
<p> &#8211; To see on the console Webfiltering doing its work:<br />
<strong>FG200# diagnose debug application urlfilter 1</strong></p>
<p>FG200 # id=93000 pid=50 main-696 in main.c received pkt:count=197, a=/tmp/.thttp.socket/21<br />
id=22009 received a request /tmp/.thttp.socket, addr_len=21: d=www.cnn.com:80, url=/a7Admin/SelectImage.aspx?end=document.f.largeimage.value&amp;preview=document.getElementById(&#8217;oImg2&#8242;)&amp;w=319&amp;h=215, id=913659, vfid=0, type=0, client=192.168.7.238<br />
id=93000 msg=&#8221;found it in cache&#8221;<br />
id=93003 user=&#8221;N/A&#8221; src=192.168.7.238 sport=4796 dst=157.166.224.25 dport=80 service=http cat=36 cat_desc=&#8221;News and Media&#8221; hostname=www.cnn.com url=/a7Admin/SelectImage.aspx?end=document.f.largeimage.value&amp;preview=document.getElementById(&#8217;oImg2&#8242;)&amp;w=319&amp;h=215 status=passthrough msg=&#8221;URL belongs to an allowed category in the policy&#8221;<br />
id=93000 pid=50 main-696 in main.c received pkt:count=255, a=/tmp/.thttp.socket/21<br />
id=22009 received a request /tmp/.thttp.socket, addr_len=21: d=b.mail.google.com:80, url=/mail/channel/bind?VER=6&amp;it=460207&amp;at=xn3j2v04hx65iz3ypmmyzptrbkimsf&amp;RID=rpc&amp;SID=57A1C77D6AAC35B0&amp;CI=1&amp;AID=347&amp;TYPE=html&amp;zx=8i5clc-olem8j&amp;DOMAIN=mail.google.com&amp;t=1, id=900542, vfid=0, type=0, client=192.168.7.56<br />
id=93003 user=&#8221;N/A&#8221; src=192.168.7.56 sport=4280 dst=74.125.39.189 dport=80 service=http cat=23 cat_desc=&#8221;Web-based Email&#8221; hostname=b.mail.google.com url=/mail/channel/bind?VER=6&amp;it=460207&amp;at=xn3j2v04hx65iz3ypmmyzptrbkimsf&amp;RID=rpc&amp;SID=57A1C77D6AAC35B0&amp;CI=1&amp;AID=347&amp;TYPE=html&amp;zx=8i5clc-olem8j&amp;DOMAIN=mail.google.com&amp;t=1 status=passthrough msg=&#8221;URL belongs to an allowed category in the policy&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2009/06/19/failed-to-connect-to-fortiguard-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You can&#039;t set duplex/speed settings of the Fortigate interfaces?</title>
		<link>http://yurisk.info/2009/06/10/you-cant-set-duplexspeed-settings-of-the-fortigate-interfaces/</link>
		<comments>http://yurisk.info/2009/06/10/you-cant-set-duplexspeed-settings-of-the-fortigate-interfaces/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:24:49 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=152</guid>
		<description><![CDATA[You can&#8217;t set duplex/speed settings of the Fortigate interfaces.
 Important FIX: depends on which interface you are trying to set!  [ Thanks to Chen for pointing out ]
Upon careful reexamination turns out that you can&#8217;t set duplex/speed settings of  4-port switch interfaces only,  i.e. Internal interface of Fortigate 60, 60M, 100A, 200A, [...]]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t set duplex/speed settings of the Fortigate interfaces.<br />
<strong> Important FIX: depends on which interface you are trying to set! </strong> [ Thanks to Chen for pointing out ]<br />
Upon careful reexamination turns out that you can&#8217;t set duplex/speed settings of <strong> 4-port switch interfaces only, </strong> i.e. Internal interface of Fortigate 60, 60M, 100A, 200A, and FortiWiFi-60 and also LAN interface of 500A . <br />
Tried on FG100A FortiOS v4.0,build0178,090820 (MR1) </p>
<div class="cmd">
FG100 (dmz2) # set speed<br />
100full    100M full-duplex<br />
100half    100M half-duplex<br />
10full     10M full-duplex<br />
10half     10M half-duplex<br />
auto       auto adjust speed</div>
<p>Working most of the time with Cisco gear I&#8217;m (and others) used to being able to set duplex/speed<br />
parameters on the physical interfaces to my liking.<br />
This comes as a necessity when connecting cisco to various equipment of differing quality. So it was a surprise to me when I encountered strange layer1/layer2 connectivity problem between some Fortigate 200A and cisco and tried to set manually duplex full/speed 100 on the Fortigate just to find out that it is impossible to do it on the Fortigate.<br />
It was possible back in the days of FortiOS 2.80 (and early 3.0 &#8211; I guess up until MR5)  :</p>
<p><strong># conf sys int</strong><br />
(interface)# edit internal<br />
(internal)# set speed</p>
<p>100full 100M full-duplex<br />
100half 100M half-duplex<br />
10full 10M full-duplex<br />
10half 10M half-duplex</p>
<p>But then Fortinet dropped this option and the only (not direct) explanation<br />
found on their site is this memo:<br />
&#8220;Locked-down port policies (forcing speed, duplex, and link capabilities with auto-negotiation disabled) are<br />
outdated. Legacy and historical reasons for forced setup with auto-negotiation disabled date<br />
back many years when the technology was new&#8230;&#8221;</p>
<p>Now we can  see what is the negotiated status of the links<br />
(this command also shows errors/collisions/MTU on the interface) :</p>
<p><strong>FG100 # diagnose hardware deviceinfo nic internal</strong><br />
Description VIA VT6102 Rhine-II<br />
Part_Number N/A<br />
Driver_Name via-rhine<br />
Driver_Version 1.1.17<br />
PCI_Vendor 0&#215;1106<br />
PCI_Device_ID 0&#215;3065<br />
PCI_Subsystem_Vendor 0&#215;3065<br />
PCI_Subsystem_ID 0&#215;1106<br />
PCI_Revision_ID 0&#215;74<br />
PCI_Address 0:12.0<br />
PCI_Bus_Type<br />
Memory 0&#215;0000f400<br />
IRQ 11<br />
System_Device_Name internal<br />
Current_HWaddr 00:09:0f:30:32:11 #In HA set up primary member would have different , virtual MAC address , for more see here <a href="http://kc.fortinet.com/default.asp?SID=&amp;Lang=1&amp;id=1772">FortiOS v3.0 HA Cluster virtual MAC addresses </a><br />
Permanent_HWaddr 00:09:0f:30:32:11<br />
<strong>Link up </strong><br />
<strong>Speed 100 </strong><br />
<strong>Duplex forced full </strong><br />
FlowControl off<br />
State up(0&#215;00001103)<br />
MTU_Size 1392<br />
Rx_Packets 89944267<br />
Tx_Packets 73437299<br />
Rx_Bytes 370540924<br />
Tx_Bytes 428118992<br />
Rx_Errors 0<br />
Tx_Errors 0<br />
Rx_Dropped 0<br />
Tx_Dropped 0<br />
Multicast 8810<br />
Collisions 0<br />
Rx_Length_Errors 0<br />
Rx_Over_Errors -0<br />
Rx_CRC_Errors 0<br />
Rx_Frame_Errors 0<br />
Rx_FIFO_Errors 0<br />
Rx_Missed_Errors 0<br />
Tx_Aborted_Errors 0<br />
Tx_Carrier_Errors 0<br />
Tx_FIFO_Errors 0<br />
Tx_Heartbeat_Errors 0<br />
Tx_Window_Errors 0<br />
Tx_Single_Collision_Frames 0<br />
Tx_Multiple_Collision_Frames 0<br />
Rx_Frame_Too_Longs 0<br />
Rx_Symbol_Errors 0<br />
Rx_Control_Unknown_Opcodes 0<br />
Rx_Pause_Frames 0<br />
Tx_Pause_Frames 0<br />
Scatter_Gather OFF<br />
poll_intr_switch 0<br />
rx_tasklet_pkts 92505560<br />
xmit queue 0<br />
recv queue -64<br />
phy_id= 1/1</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2009/06/10/you-cant-set-duplexspeed-settings-of-the-fortigate-interfaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debug VPN in Fortigate &#8211; seeing is believing</title>
		<link>http://yurisk.info/2009/04/21/debug-vpn-in-fortigate-seeing-is-believing/</link>
		<comments>http://yurisk.info/2009/04/21/debug-vpn-in-fortigate-seeing-is-believing/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 16:54:19 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Fortigate]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=103</guid>
		<description><![CDATA[You can&#8217;t really debug VPN problems with static show commands, if VPN fails to function you HAVE to
see it happening real-time. Below I list few debug commands that do just that for IPSEC site-to-site
tunnels in Fortigate.
Here:
192.168.168.254   &#8211; IP address on the LAN interface of the fortigate
10.170.15.131&#8242;    &#8211; IP address on [...]]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t really debug VPN problems with static show commands, if VPN fails to function you HAVE to<br />
see it happening real-time. Below I list few debug commands that do just that for IPSEC site-to-site<br />
tunnels in Fortigate.<br />
Here:<br />
192.168.168.254   &#8211; IP address on the LAN interface of the fortigate<br />
10.170.15.131&#8242;    &#8211; IP address on the remote LAN<br />
200.199.20.162   &#8211; (sanitazed) IP of the wan interface of Fortigate<br />
72.21.207.65   &#8211;  (sanitazed) IP of the  remote VPN peer</p>
<p>-Enable debugging<br />
 <strong>FG100A# diag debug en</strong></p>
<p>- Enable debug messages for specific application , here we are interested in IKE (note debug level -1,<br />
following logic I enabled first +1, 255 etc and surprisingly had no effect at all )<br />
 <strong>FG100A # diag debug app ike -1</strong></p>
<p>I, personally, prefer also to do sniffer on the tests I  do after, so:<br />
<strong>FG100A # diagnose sniffer packet any &#8216;host 10.170.15.131&#8242;</strong></p>
<p>Now open another ssh session to the same FG and do pings to IP on the other side of VPN tunnel<br />
with source IP of internal LAN (or just ask client to do pings from LAN, depends on encryption domain) :</p>
<p>- Configure pings to go with the source interface of LAN of the Fortigate:<br />
<strong>FG100A # exec ping-options source 192.168.168.254</strong><br />
- No wdo pings to bring up the VPN tunnel<br />
<strong>FG100A # exec ping 10.170.15.131</strong><br />
PING 10.170.15.131 (10.170.15.131): 56 data bytes<br />
64 bytes from 10.170.15.131: icmp_seq=1 ttl=252 time=73.2 ms<br />
64 bytes from 10.170.15.131: icmp_seq=2 ttl=252 time=116.3 ms<br />
64 bytes from 10.170.15.131: icmp_seq=3 ttl=252 time=110.3 ms<br />
64 bytes from 10.170.15.131: icmp_seq=4 ttl=252 time=138.4 ms</p>
<p>Now return to the 1st ssh session and you will see:</p>
<p>interfaces=[any]<br />
filters=[host 10.170.15.131]<br />
0:Robophone1:Robophone1/2: IPsec SA connect 3 200.199.20.162-&gt;72.21.207.65:500  , natt_mode=0<br />
0:Robophone1: using existing connection, dpd_fail=0<br />
0:Robophone1: found phase2 Robophone1/2<br />
0:Robophone1: IPsec SA connect 3 200.199.20.162-&gt;72.21.207.65:500 negotiating<br />
0:Robophone1:1990: cookie d3351433913f978c/069bcd9a38263f3a:5125b9f3<br />
0:Robophone1:1990:Robophone1/2:471585: initiator selectors 0 200.199.20.162:0-&gt;10.170.15.131:0<br />
0:Robophone1:1990: sent IKE msg (quick_i1send): 200.199.20.162:500-&gt;72.21.207.65:500, len=148<br />
Robophone: Initiator: sent 72.21.207.65quick mode message #1 (OK)<br />
0: comes 72.21.207.65:500-&gt;200.199.20.162:500,ifindex=3&#8230;.<br />
0: exchange=Quick id=d3351433913f978c/069bcd9a38263f3a:5125b9f3 len=156<br />
0: found Robophone1 200.199.20.1623 -&gt; 72.21.207.65:500<br />
0:RobophoneRobophone1:1990:Robophone1/2:471585: responder selectors 0 200.199.20.162:0-&gt;10.170.15.131:0<br />
0:Robophone1:1990: sent IKE msg (quick_i2send): 200.199.20.162:500-&gt;72.21.207.65:500, len=60<br />
0:Robophone1:1990:Robophone1/2:471585: set sa life soft seconds=1775.<br />
0:Robophone1:1990:Robophone1/2:471585: set sa life hard seconds=1800.0:Robophone1:1990:Robophone1/2:471585: add SA #src=1 #dst=1<br />
0:Robophone1:1990:Robophone1/2:471585: src 0 4 192.168.168.0/255.255.255.0<br />
0:Robophone1:1990:Robophone1/2:471585: dst 0 1 10.170.15.131<br />
0:Robophone1:1990:Robophone1/2:471585: installed SA: SPIs=2f1c289f/ea7a510d<br />
0:Robophone1:1990:Robophone1/2:471585: sending SNMP tunnel UP trap<br />
Robophone1: Initiator: sent 72.21.207.65  quick mode message #2 (DONE)<br />
15.153033 10.170.15.131 -&gt; 200.199.20.162: icmp: echo reply<br />
16.196213 10.170.15.131 -&gt; 200.199.20.162: icmp: echo reply<br />
17.190216 10.170.15.131 -&gt; 200.199.20.162: icmp: echo reply<br />
18.218259 10.170.15.131 -&gt; 200.199.20.162: icmp: echo reply</p>
<p>4 packets received by filter<br />
0 packets dropped by kernel</p>
<p>Dont forget to disable debug afterwards</p>
<p><strong>FG100A # diag debug app ike 0</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2009/04/21/debug-vpn-in-fortigate-seeing-is-believing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
