From owner-freebsd-questions@freebsd.org Fri May 4 04:05:11 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F61AFC647F for ; Fri, 4 May 2018 04:05:11 +0000 (UTC) (envelope-from srs0=+vbu=hx=mail.sermon-archive.info=doug@sermon-archive.info) Received: from mail.sermon-archive.info (sermon-archive.info [71.177.216.148]) by mx1.freebsd.org (Postfix) with ESMTP id D08F47E78E for ; Fri, 4 May 2018 04:05:10 +0000 (UTC) (envelope-from srs0=+vbu=hx=mail.sermon-archive.info=doug@sermon-archive.info) Received: from [10.0.1.251] (mini [10.0.1.251]) by mail.sermon-archive.info (Postfix) with ESMTPSA id 40cdhJ1VQwz2fjQk for ; Thu, 3 May 2018 21:05:04 -0700 (PDT) From: Doug Hardie Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: UDP packet transmission Message-Id: <91591EE5-91EA-4C79-BE7B-A5F9F53CFADA@mail.sermon-archive.info> Date: Thu, 3 May 2018 21:05:03 -0700 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.3445.6.18) X-Virus-Scanned: clamav-milter 0.99.4 at mail X-Virus-Status: Clean X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 04:05:11 -0000 I have a somewhat unusual situation and have not found a solution for = it. I have a remote machine running 12 current. It has two independent = internet connections. They are from two different sources and have = different IP addresses. One is a fixed IP address and the other = dynamic. The purpose is to be able to access the device if one of those = interfaces is down. It is only accessed when problems occur. Typically = that is when the fixed address is not accessible. The problem is there = is no way to know the dynamic address. To address this, I tried sending a UDP packet through the dynamic IP = link to another machine at a fixed IP address. It records the IP = address that originated the packet and logs it. Hence, I can easily = find the last dynamic IP that was used and access the device through = that. However, to make that happen, I need to be able to send a UDP = packet that goes through a specific interface and does not use the = routing table. The most frequent approach I have found is to bind the socket to only = the dynamic IP address's interface. However, that does change the = originating IP address in the packet to that interface, but continues to = transmit via the interface found in the routing table. Another suggestion was to use raw sockets. However, all the reading on = that (Stevens et al) indicate that the packet will still be transmitted = on the interface selected in the routing table. Yet another suggestion was to change the routing table temporarily, send = the packet, and then change it back. Besides a lot of potential for = weird stuff, it would break a number of other connections going through = the fixed IP address. =20 I am hoping there is another solution that would be better. Thanks, -- Doug