{
    my $inkernel = $pppoe{InKernel} || "no";
    my $timeout = $pppoe{Timeout} || 120; # PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
    my $device = $pppoe{PhysicalInterface};
    my $syncPPP = $pppoe{SynchronousPPP} || "no";

    if ($inkernel eq "yes")
    {
	# Find Roaring Penguin pppoe plugin
	my ($plugin) = glob "/usr/lib/pppd/*/rp-pppoe.so";
	$plugin ||= "pppoe_plugin_could_not_be_found";

	$OUT = "plugin $plugin\n";
	if ($syncPPP eq "yes")
	{
	    $OUT .= "sync\n";
	}
	$OUT .= "$device";
    }
    else
    {
	$OUT = "pty '/usr/sbin/pppoe -I $device -T $timeout -U -m 1412'";
	if ($syncPPP eq "yes")
	{
	    $OUT .= " -s\nsync";
	}
    }
}
