How can I import an IP List into a USG310 via shell script

cfts_ea
cfts_ea Posts: 19  Freshman Member
First Comment Fifth Anniversary
edited August 2023 in Security

I created a Python script to import the IPs and format them as per what I can find out, However that's where I seems to be stuck, im unable to create a working shell script .zysh to import said IPs, any help would really be appreciated.

The Zyxel in Question is a USG310, and even though its EOL its a solid piece of kit.

Here's what i done so far:

# https://feodotracker.abuse.ch/downloads/ipblocklist.txt
!
object-group service CC2
description CommandControl IPs
address-object cc1 1.221.179.74
address-object cc2 100.10.72.114
address-object cc3 100.4.182.242
address-object cc4 102.156.115.75
address-object cc5 102.156.192.103
address-object cc6 102.156.234.92
address-object cc7 102.156.6.123
address-object cc8 102.157.165.228
address-object cc9 102.159.177.74
address-object cc10 102.159.81.188

address-object cc486 98.147.155.235
address-object cc487 98.163.227.79
address-object cc488 98.187.21.2
address-object cc489 98.4.43.111
!

Any help greatly appreciated.

Best Answers

  • Zyxel_Emily
    Zyxel_Emily Posts: 1,396  Zyxel Employee
    Zyxel Certified Network Administrator - Security Zyxel Certified Sales Associate 100 Answers 1000 Comments
    Answer ✓

    Hi @cfts_ea,

    Enter the following commands in a file and save it as zysh. Then upload the zysh file to USG310 and apply it.

    configure terminal
    address-object cc1 1.221.179.74
    address-object cc2 100.10.72.114
    address-object cc3 100.4.182.242
    address-object cc4 102.156.115.75
    address-object cc5 102.156.192.103
    address-object cc6 102.156.234.92
    address-object cc7 102.156.6.123
    address-object cc8 102.157.165.228
    address-object cc9 102.159.177.74
    address-object cc10 102.159.81.188


    address-object cc486 98.147.155.235
    address-object cc487 98.163.227.79
    address-object cc488 98.187.21.2
    address-object cc489 98.4.43.111
    write

  • Zyxel_Emily
    Zyxel_Emily Posts: 1,396  Zyxel Employee
    Zyxel Certified Network Administrator - Security Zyxel Certified Sales Associate 100 Answers 1000 Comments
    edited September 2023 Answer ✓

    Hi @cfts_ea,

    configure terminal
    object-group address CC2
    address-object cc1
    address-object cc2
    ...
    address-object cc128
    exit
    write

    Note: On USG310, the maximum address object in one address group is 128.

All Replies

  • Zyxel_Emily
    Zyxel_Emily Posts: 1,396  Zyxel Employee
    Zyxel Certified Network Administrator - Security Zyxel Certified Sales Associate 100 Answers 1000 Comments
    Answer ✓

    Hi @cfts_ea,

    Enter the following commands in a file and save it as zysh. Then upload the zysh file to USG310 and apply it.

    configure terminal
    address-object cc1 1.221.179.74
    address-object cc2 100.10.72.114
    address-object cc3 100.4.182.242
    address-object cc4 102.156.115.75
    address-object cc5 102.156.192.103
    address-object cc6 102.156.234.92
    address-object cc7 102.156.6.123
    address-object cc8 102.157.165.228
    address-object cc9 102.159.177.74
    address-object cc10 102.159.81.188


    address-object cc486 98.147.155.235
    address-object cc487 98.163.227.79
    address-object cc488 98.187.21.2
    address-object cc489 98.4.43.111
    write

  • cfts_ea
    cfts_ea Posts: 19  Freshman Member
    First Comment Fifth Anniversary
    edited September 2023

    Thanks Emily, your a star. :)

    One question, is the a way to add the above to a object group 'CC2'?

  • Zyxel_Emily
    Zyxel_Emily Posts: 1,396  Zyxel Employee
    Zyxel Certified Network Administrator - Security Zyxel Certified Sales Associate 100 Answers 1000 Comments
    edited September 2023 Answer ✓

    Hi @cfts_ea,

    configure terminal
    object-group address CC2
    address-object cc1
    address-object cc2
    ...
    address-object cc128
    exit
    write

    Note: On USG310, the maximum address object in one address group is 128.

  • cfts_ea
    cfts_ea Posts: 19  Freshman Member
    First Comment Fifth Anniversary

    Thank you, all is clear now, I can now implement my own blocks list with reasonable ease, i looks at how to automate the updates later.

Security Highlight