{
    "content": [
        {
            "type": "text",
            "text": "# ipset-translate(8) (man)\n\n**Summary:** ipset-translate — translation tool to migrate from ipset to nftables\n\n## Examples\n\n- `Basic operation examples.`\n- `Single command translation, assuming the original file:`\n- `create test1 hash:ip,port family inet counters timeout 300 hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d`\n- `add test1 1.1.1.1,udp:20`\n- `add test1 1.1.1.1,21`\n- `create test2 hash:ip,port family inet hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d`\n- `which results in the following translation:`\n- `root@machine:~# ipset-translate restore < file.ipt`\n- `add set inet global test1 { type ipv4addr . inetproto . inetservice; counter; timeout 300s; size 65536; }`\n- `add element inet global test1 { 1.1.1.1 . udp . 20 }`\n- `add element inet global test1 { 1.1.1.1 . tcp . 21 }`\n- `add set inet global test2 { type ipv4addr . inetproto . inetservice; size 65536; }`\n\n## See Also\n\n- nft(8)\n- ipset(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (8 lines)\n- **USAGE** (4 lines)\n- **EXAMPLES** (18 lines)\n- **LIMITATIONS** (11 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHORS** (13 lines)\n\n## Full Content\n\n### NAME\n\nipset-translate — translation tool to migrate from ipset to nftables\n\n### DESCRIPTION\n\nThis tool allows system administrators to translate a given IP sets file to nftables(8).\n\nThe only available command is:\n\n\n• ipset-translate restores < file.ipt\n\n### USAGE\n\nThe  ipset-translate  tool  reads an IP sets file in the syntax produced by ipset(8) save. No\nset modifications occur, this tool is a text converter.\n\n### EXAMPLES\n\nBasic operation examples.\n\nSingle command translation, assuming the original file:\n\ncreate test1 hash:ip,port family inet counters timeout 300 hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d\nadd test1 1.1.1.1,udp:20\nadd test1 1.1.1.1,21\ncreate test2 hash:ip,port family inet hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d\n\nwhich results in the following translation:\n\nroot@machine:~# ipset-translate restore < file.ipt\nadd set inet global test1 { type ipv4addr . inetproto . inetservice; counter; timeout 300s; size 65536; }\nadd element inet global test1 { 1.1.1.1 . udp . 20 }\nadd element inet global test1 { 1.1.1.1 . tcp . 21 }\nadd set inet global test2 { type ipv4addr . inetproto . inetservice; size 65536; }\n\n### LIMITATIONS\n\nA few IP sets options may be not supported because they are  not  yet  implemented  in  nfta‐‐\nbles(8).\n\nContrary to nftables(8), IP sets are not attached to a specific table.  The translation util‐\nity assumes that sets are created in a table whose name is global and  family  is  inet.  You\nmight  want  to update the resulting translation to use a different table name and family for\nyour sets.\n\nTo get up-to-date information about this, please head to https://wiki.nftables.org/.\n\n### SEE ALSO\n\nnft(8), ipset(8)\n\n### AUTHORS\n\nThe nftables framework has been written by the Netfilter Project (https://www.netfilter.org).\n\nThis manual page was written by Pablo Neira Ayuso <pablo@netfilter.org>.\n\nThis documentation is free/libre under the terms of the GPLv2+.\n\nThis tool was funded through the NGI0 PET Fund, a fund established by  NLnet  with  financial\nsupport from the European Commission's Next Generation Internet programme, under the aegis of\nDG Communications Networks, Content and Technology under grant agreement No 825310.\n\n\n\nMay 31, 2021                          IPSET-TRANSLATE(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "ipset-translate",
        "section": "8",
        "mode": "man",
        "summary": "ipset-translate — translation tool to migrate from ipset to nftables",
        "synopsis": null,
        "flags": [],
        "examples": [
            "Basic operation examples.",
            "Single command translation, assuming the original file:",
            "create test1 hash:ip,port family inet counters timeout 300 hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d",
            "add test1 1.1.1.1,udp:20",
            "add test1 1.1.1.1,21",
            "create test2 hash:ip,port family inet hashsize 1024 maxelem 65536 bucketsize 12 initval 0xb5c4be5d",
            "which results in the following translation:",
            "root@machine:~# ipset-translate restore < file.ipt",
            "add set inet global test1 { type ipv4addr . inetproto . inetservice; counter; timeout 300s; size 65536; }",
            "add element inet global test1 { 1.1.1.1 . udp . 20 }",
            "add element inet global test1 { 1.1.1.1 . tcp . 21 }",
            "add set inet global test2 { type ipv4addr . inetproto . inetservice; size 65536; }"
        ],
        "see_also": [
            {
                "name": "nft",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/nft/8/json"
            },
            {
                "name": "ipset",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ipset/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 13,
                "subsections": []
            }
        ]
    }
}