• No related posts.

      • No related posts.

        • No related posts.

          • No related posts.

              No related posts.

            Script to generate interface configs on Linux

            Generate ifcfg-eth1 307-366 configs.

            touch ifcfg-eth1:{307..366}
            for f in ifcfg-eth1:{307..366}; do cat origfile > “$f”; done
            for f in eth1:{307..366}; do echo “DEVICE=$f” >> “ifcfg-$f”; done
            for f in {307..366}; do echo “IPADDR=aaa.bbb.ccc.$((f-239))” >> “ifcfg-eth1:$f”; done

            origfile contains:

            GATEWAY=eee.fff.ggg.hhh
            TYPE=Ethernet
            BOOTPROTO=none
            NETMASK=255.255.255.192

            Related posts:

            1. Sysctl Linux
            2. Show Interface Reference
            3. How do I find out Linux Disk utilization RHEL/Centos?
            This entry was posted in Centos, Debian, Fedora, Linux, Programming, Redhat, Scripting, Ubuntu and tagged , , , , , , , .

            Leave a Reply