• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Multiple NIC Hosts

Scheduled Pinned Locked Moved Solved
Bug Reports
4
32
9.6k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    Tom Elliott
    last edited by Mar 3, 2015, 9:41 AM

    Updated to reflect the change. Pushed to inits as well.

    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Mar 3, 2015, 1:37 PM

      Would the problems we’re seeing be related to the fact we bring the interface up, but we don’t bring it back down, so when the interface is added and the loop happens, it can’t get dhcp because it believes the link is up?

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • C
        cspence Developer
        last edited by Mar 3, 2015, 4:29 PM

        Finally got a chance to play with it, and I have a solution.

        Insert a 5-second sleep between setting the interface up and checking the link status (we can’t just check before it gets a chance to find out if it is connected to a cable). Here’s the snippet as modified.

        [CODE]…
        /sbin/ip link set $iface up

        Provide time for the interface to update linkstate

        sleep 5
        linkstate=$(/bin/cat /sys/class/net/$iface/carrier)
        …[/CODE]

        Works on my end.

        …and if you wait just a second, I’ll have an optimized version…

        1 Reply Last reply Reply Quote 0
        • C
          cspence Developer
          last edited by Mar 3, 2015, 4:48 PM

          [CODE]# Enable all interfaces
          ifaces=$(ls -1 /sys/class/net | tr -d ‘@’)
          for iface in $ifaces; do
          /sbin/ip link set $iface up
          done

          Provide time for interfaces to detect their state

          sleep 5

          echo “auto lo” > /etc/network/interfaces
          echo “iface lo inet loopback” >> /etc/network/interfaces

          for iface in $ifaces; do
          linkstate=$(/bin/cat /sys/class/net/$iface/carrier)
          if [[ “x$linkstate” = “x1” -a “x$iface” != “xlo” ]]; then
          echo “auto $iface” >> /etc/network/interfaces
          echo “iface $iface inet dhcp” >> /etc/network/interfaces
          echo -e “\tudhcpc_opts -t 100 -T 20\n” >> /etc/network/interfaces
          fi
          /sbin/ip link set $iface down
          done[/CODE]

          This solution only requires one sleep rather than five-seconds of sleep time per interface.

          Edit: Fixed typos.

          1 Reply Last reply Reply Quote 0
          • T
            Tom Elliott
            last edited by Mar 3, 2015, 4:58 PM

            Bad statement.

            linkstate=$(/bin/cat /sys/class/net/$iface

            Should be
            linkstate=$(/bin/cat /sys/class/net/$iface)

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 0
            • T
              Tom Elliott
              last edited by Mar 3, 2015, 4:59 PM

              Also, shouldn’t the tr -d be tr -d ‘@’ not tr -d ‘0’?

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • C
                cspence Developer
                last edited by Mar 3, 2015, 5:15 PM

                [quote=“Tom Elliott, post: 43117, member: 7271”]Also, shouldn’t the tr -d be tr -d ‘@’ not tr -d ‘0’?[/quote]

                Sorry, I was copying off code from my cellphone and wasn’t thinking about what I was typing. Also caught another typo on the udhcpc_opt statement.

                Fixed the typos in the original post.

                1 Reply Last reply Reply Quote 0
                • T
                  Tom Elliott
                  last edited by Mar 3, 2015, 5:56 PM

                  There’s one more issue

                  Shouldn’t the cat be reading a file, not the directory?

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  1 Reply Last reply Reply Quote 0
                  • C
                    cspence Developer
                    last edited by Mar 3, 2015, 5:58 PM

                    [quote=“Tom Elliott, post: 43128, member: 7271”]There’s one more issue

                    Shouldn’t the cat be reading a file, not the directory?[/quote]

                    Yes. Fixed again. I really should have slept more last night. 😕

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by Mar 3, 2015, 6:42 PM

                      It’s all good, you should see the issues I forget about, like using my mac address implicitly in the inventory and wondering why everybody else is getting repeated inventory errors.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • C
                        cspence Developer
                        last edited by Mar 3, 2015, 6:49 PM

                        [quote=“Tom Elliott, post: 43130, member: 7271”]It’s all good, you should see the issues I forget about, like using my mac address implicitly in the inventory and wondering why everybody else is getting repeated inventory errors.[/quote]

                        Now that’s a good one.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by Mar 4, 2015, 11:56 PM

                          Thank you guys for working on this and making it all run smoothly!

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 2 / 2
                          2 / 2
                          • First post
                            21/32
                            Last post

                          181

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project