> Source: [sk106216](https://support.checkpoint.com/results/sk/sk106216)

# sk106216 - How to assign internal IP addresses with country flags and map in SmartEvent

| Property | Value |
|----------|-------|
| Solution ID | sk106216 |
| Date Created | 2015-05-26 |
| Last Modified | 2016-09-08 |
| Technical Level | General |
| Products | Security Management Server |
| Versions | R82.10, R82, R81.20, R82.20 |
| OS | Gaia |

## Solution

From SmartEvent NGSE, you can assign countries to internal (reserved) IP ranges. This will show the country flag and the country map for events with these internal IP addresses.

For NGSE
--------

Follow this procedure on SmartEvent NGSE server:

1. Connect to command line on SmartEvent NGSE server.   

2. Log in to Expert mode.   

3. Stop Check Point services:

   *\[Expert@HostName\]# cpstop*   

4. Backup the *$RTDIR/smartlog/conf/ip2country.csv* file:

   *\[Expert@HostName\]# cp $RTDIR/smartlog/conf/ip2country.csv $RTDIR/smartlog/conf/ip2country.csv_ORIGINAL*   

5. Edit the *$RTDIR/smartlog/conf/ip2country.csv* file in Vi editor:

   *\[Expert@HostName\]# vi $RTDIR/smartlog/conf/ip2country.csv*
   1. Find a line with the desired country.   

   2. Add a similar line (e.g., copy-and-paste) while changing the 2 first values that represent the IP range:

      * First value represents the ***first IP address*** in the range in a decimal format.
      * Second value represents the ***last IP address*** in the range in a decimal format.

      *Example*:
      To assign the network 192.168.1.1/24 - 192.168.1.254/24 to the United States, add this line:  
      `"3232235777","3232236030","iana","410227200","US","USA","United States"`   

   3. Save the file and exit from Vi editor.

   Notes:
   * To convert the IP addresses to decimal format used in the file, use a Decimal IP Calculator (available on the Internet).
   * The location of the new line in the file is irrelevant.
   * If you edit this file on a Windows machine and transfer it back to SmartEvent NGSE server, you must run *dos2unix* command on that file:  
     *\[Expert@HostName\]# dos2unix $RTDIR/smartlog/conf/ip2country.csv*

   <br />

   <br />

6. Start Check Point services:

   *\[Expert@HostName\]# cpstart*

For R80
-------

Follow this procedure on SmartEvent R80 server:

1. Connect to command line on SmartEvent R80 server.   

2. Log in to Expert mode.   

3. Stop Check Point services:

   *\[Expert@HostName\]# cpstop*   

4. Backup the *$INDEXERDIR/conf/ip2country.csv* file:

   *\[Expert@HostName\]# cp $INDEXERDIR/conf/ip2country.csv $INDEXERDIR/conf/ip2country.csv_ORIGINAL*   

5. Edit the $INDEXERDIR*/conf/ip2country.csv* file in Vi editor:

   *\[Expert@HostName\]# vi $INDEXERDIR/conf/ip2country.csv*
   1. Find a line with the desired country.   

   2. Add a similar line (e.g., copy-and-paste) while changing the 2 first values that represent the IP range:

      * First value represents the ***first IP address*** in the range in a decimal format.
      * Second value represents the ***last IP address*** in the range in a decimal format.

      *Example*:
      To assign the network 192.168.1.1/24 - 192.168.1.254/24 to the United States, add this line:  
      `"3232235777","3232236030","iana","410227200","US","USA","United States"`   

   3. Save the file and exit from Vi editor.

   Notes:
   * To convert the IP addresses to decimal format used in the file, use a Decimal IP Calculator (available on the Internet).
   * The location of the new line in the file is irrelevant.
   * If you edit this file on a Windows machine and transfer it back to SmartEvent R80 server, you must run *dos2unix* command on that file:  
     *\[Expert@HostName\]# dos2unix $INDEXERDIR/conf/ip2country.csv*

   <br />

   <br />

6. Start Check Point services:

   *\[Expert@HostName\]# cpstart*

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
