Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Newer Version of the dhclient-script

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    29 Posts 4 Posters 9.8k Views
    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
      the6thday
      last edited by

      push

      1 Reply Last reply Reply Quote 0
      • B
        Beerman
        last edited by

        Will this Issue be fixed in Version 2?

        I think with the logs and the explanation inside this thread the problem is reasonably  specified.

        But if you need another tests/logs, I will give it to you.

        Thx!

        1 Reply Last reply Reply Quote 0
        • E
          eri--
          last edited by

          Its not a dhclient issue.
          Try this https://rcs.pfsense.org/projects/pfsense/repos/mainline/commits/5766add89187bf47c225f67697e37ca25b0dbc71 or wait for the next snapshots.

          1 Reply Last reply Reply Quote 0
          • B
            Beerman
            last edited by

            sorry, this doesn´t fix it:

            I tried this Build:

            2.0-RC1 (i386)  built on Wed Apr 6 11:10:23 EDT 2011

            Your changes are included in this Build:

            if [ "$new_ip_address" = "$router" -o "$router" = "255.255.255.255" ]; then
                                            $ROUTE add default -iface $interface
                                            echo $ROUTE add default -iface $interface | $LOGGER
                                            # NOTE: Do not activate this for all ones address since pf(4) will try to forward packets to it.
                                            if [ "$new_ip_address" = "$router" ]; then
                                                    echo $router > /tmp/${interface}_router
                                            fi
                                    else
                                            $ROUTE add default $router
                                            echo $ROUTE add default $router | $LOGGER
                                            echo $router > /tmp/${interface}_router
                                    fi
            
            

            But for the Interface I still got:

            
            System: Gateways
            GW_OPT3 	IPTV 	255.255.255.255 	255.255.255.255 	Interfaceopt3dynamic gateway
            

            and I got the same Problems…

            1 Reply Last reply Reply Quote 0
            • E
              eri--
              last edited by

              Can you remove the /tmp/*_router and try dhclient or Save button on the interface page and see if you will get the same?
              Maybe making sure that a remnant file is not causing issues.

              Otherwise something is not matching in that if statement.

              1 Reply Last reply Reply Quote 0
              • B
                Beerman
                last edited by

                Sorry, no difference…

                after removing the *_router files in /tmp and renewing DHCP-Lease GW is still 255.255.255.255

                /tmp(20): cat vr2_vlan8_router 
                255.255.255.255
                
                ----
                
                GW_OPT3 	IPTV 	255.255.255.255 	255.255.255.255 	Interfaceopt3dynamic gateway
                
                
                1 Reply Last reply Reply Quote 0
                • E
                  eri--
                  last edited by

                  Can you try by changing that section from

                  if [ "$new_ip_address" = "$router" -o "$router" = "255.255.255.255" ]; then
                                                 $ROUTE add default -iface $interface
                                                 echo $ROUTE add default -iface $interface | $LOGGER
                                                 # NOTE: Do not activate this for all ones address since pf(4) will try to forward packets to it.
                                                 if [ "$new_ip_address" = "$router" ]; then
                                                         echo $router > /tmp/${interface}_router
                                                 fi
                                         else
                                                 $ROUTE add default $router
                                                 echo $ROUTE add default $router | $LOGGER
                                                 echo $router > /tmp/${interface}_router
                                         fi

                  to

                  if [ "$router" = "255.255.255.255" ]; then
                                                 $ROUTE add default -iface $interface
                                                 echo $ROUTE add default -iface $interface | $LOGGER
                                                 # NOTE: Do not activate this for all ones address since pf(4) will try to forward packets to it.
                                         elif [ "$new_ip_address" = "$router" ]; then
                                                $ROUTE add default -iface $interface
                                                 echo $ROUTE add default -iface $interface | $LOGGER
                                                 echo $router > /tmp/${interface}_router
                                         else
                                                 $ROUTE add default $router
                                                 echo $ROUTE add default $router | $LOGGER
                                                 echo $router > /tmp/${interface}_router
                                         fi

                  Also please check which of the messages from the above are in your system log.

                  1 Reply Last reply Reply Quote 0
                  • B
                    Beerman
                    last edited by

                    Hi,

                    I changed the script to:

                    for router in $new_routers; do
                                            if [ "$router" = "255.255.255.255" ]; then
                                                    $ROUTE add default -iface $interface
                                                    echo $ROUTE add default -iface $interface | $LOGGER
                                                    $LOGGER "TEST1"
                                                    # NOTE: Do not activate this for all ones address since pf(4) will try to forward packets to it.
                                            elif [ "$new_ip_address" = "$router" ]; then
                                                   $ROUTE add default -iface $interface
                                                    echo $ROUTE add default -iface $interface | $LOGGER
                                                    $LOGGER "TEST2"
                                                    echo $router > /tmp/${interface}_router
                                            else
                                                    $ROUTE add default $router
                                                    echo $ROUTE add default $router | $LOGGER
                                                    $LOGGER "TEST3"
                                                    echo $router > /tmp/${interface}_router
                                            fi
                    
                    

                    You see, for testing I added $LOGGER "TEST1", $LOGGER "TEST2" and $LOGGER "TEST3" in each If, elif and else block.

                    But in System-Log i can´t see any TEST1, TEST2 or TEST3

                    Apr 8 00:02:03 	dhclient[4730]: bound to 84.142.199.75 -- renewal in 43200 seconds.
                    Apr 8 00:02:03 	dhclient: Creating resolv.conf
                    Apr 8 00:02:02 	dhclient: New Classless Static Routes (vr2_vlan8): 193.158.137.14/32 84.142.255.254 87.140.255.0/25 84.142.255.254 87.141.128.0/17 84.142.255.254 193.158.34.0/23 84.142.255.254 212.184.168.0/24 84.142.255.254 217.6.167.160/27 84.142.255.254
                    Apr 8 00:02:02 	dhclient: Adding new routes to interface: vr2_vlan8
                    Apr 8 00:02:02 	dhclient: New Routers (vr2_vlan8): 255.255.255.255
                    Apr 8 00:02:02 	dhclient: New Broadcast Address (vr2_vlan8): 84.142.255.255
                    Apr 8 00:02:02 	dhclient: New Subnet Mask (vr2_vlan8): 255.255.192.0
                    Apr 8 00:02:02 	dhclient: New IP Address (vr2_vlan8): 84.142.199.75
                    Apr 8 00:02:02 	dhclient: ifconfig vr2_vlan8 inet 84.142.199.75 netmask 255.255.192.0 broadcast 84.142.255.255
                    Apr 8 00:02:02 	dhclient: Starting add_new_address()
                    Apr 8 00:02:02 	dhclient: BOUND
                    Apr 8 00:02:02 	dhclient[4730]: DHCPACK from 84.142.255.254
                    Apr 8 00:02:02 	dhclient[4730]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:02:02 	dhclient: ARPCHECK
                    Apr 8 00:02:00 	dhclient: ARPSEND
                    Apr 8 00:02:00 	dhclient[4730]: DHCPOFFER from 84.142.255.254
                    Apr 8 00:02:00 	dhclient[4730]: DHCPDISCOVER on vr2_vlan8 to 255.255.255.255 port 67 interval 2
                    Apr 8 00:01:54 	dhclient[4730]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:51 	dhclient[4730]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:49 	dhclient[4730]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:47 	dhclient[4730]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:47 	dhclient: PREINIT
                    Apr 8 00:01:46 	dhclient[61966]: exiting.
                    Apr 8 00:01:46 	dhclient[61966]: exiting.
                    Apr 8 00:01:46 	dhclient[61966]: connection closed
                    Apr 8 00:01:46 	dhclient[61966]: connection closed
                    Apr 8 00:01:46 	dhclient[61832]: bound to 84.142.199.75 -- renewal in 43200 seconds.
                    Apr 8 00:01:46 	dhclient: Creating resolv.conf
                    Apr 8 00:01:46 	dhclient: New Classless Static Routes (vr2_vlan8): 193.158.137.14/32 84.142.255.254 87.140.255.0/25 84.142.255.254 87.141.128.0/17 84.142.255.254 193.158.34.0/23 84.142.255.254 212.184.168.0/24 84.142.255.254 217.6.167.160/27 84.142.255.254
                    Apr 8 00:01:46 	dhclient: Adding new routes to interface: vr2_vlan8
                    Apr 8 00:01:46 	dhclient: New Routers (vr2_vlan8): 255.255.255.255
                    Apr 8 00:01:46 	dhclient: New Broadcast Address (vr2_vlan8): 84.142.255.255
                    Apr 8 00:01:46 	dhclient: New Subnet Mask (vr2_vlan8): 255.255.192.0
                    Apr 8 00:01:46 	dhclient: New IP Address (vr2_vlan8): 84.142.199.75
                    Apr 8 00:01:46 	dhclient: ifconfig vr2_vlan8 inet 84.142.199.75 netmask 255.255.192.0 broadcast 84.142.255.255
                    Apr 8 00:01:46 	dhclient: Starting add_new_address()
                    Apr 8 00:01:46 	dhclient: BOUND
                    Apr 8 00:01:46 	dhclient[61832]: DHCPACK from 84.142.255.254
                    Apr 8 00:01:46 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:46 	dhclient: ARPCHECK
                    Apr 8 00:01:44 	dhclient: ARPSEND
                    Apr 8 00:01:43 	dhclient[61832]: DHCPOFFER from 84.142.255.254
                    Apr 8 00:01:43 	dhclient[61832]: DHCPDISCOVER on vr2_vlan8 to 255.255.255.255 port 67 interval 1
                    Apr 8 00:01:38 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:33 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:31 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:29 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:28 	dhclient[61832]: DHCPREQUEST on vr2_vlan8 to 255.255.255.255 port 67
                    Apr 8 00:01:28 	dhclient: PREINIT
                    
                    

                    Gateway is still 255.255.255.255

                    GW_OPT3 	IPTV 	255.255.255.255 	255.255.255.255 	Interfaceopt3dynamic gateway
                    
                    1 Reply Last reply Reply Quote 0
                    • E
                      eri--
                      last edited by

                      I made a fix that will be in latest snapshots which should fix this by not having a gateway declared from dhcp and so no PBR will be done from pfSense and routes will be followed.

                      Please test latest snapshots and let me know.

                      1 Reply Last reply Reply Quote 0
                      • B
                        Beerman
                        last edited by

                        This fixed my issue!

                        GW_OPT3 	IPTV 	dynamic 	dynamic 	Interfaceopt3dynamic gateway
                        

                        Thank you, very much!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.