Virtual ip addresses fail to assign to PPOE Interface



  • Hello,

    My ISP allocate me a range of 5 ip addresses - One of which i want to use as the outbound address for an OpenVPN VPN.

    In doing so, i've found that my additional virtual ip addresses are not assigned to the pppoe interface when it comes up or when i create the virtual ip addresses.

    Checking the logs i see the following error:

    /firewall_virtual_ip.php: The command '/sbin/ifconfig 'pppoe0' inet '62.249.xxx.123'/'32' c' returned exit code '1', the output was 'ifconfig: ioctl (SIOCAIFADDR): Destination address required'

    and vip doest appear assigned to the pppoe interface when i run ifconfig.

    I can manually add the address using what appears to be the correct syntax:

    /sbin/ifconfig pppoe0 inet 62.249.206.123/32 alias ppoe-isp-gw-ip

    the virtual ip address appears and works as expected - i.e. the Openvpn connects from the virtual ip.

    Clearly, this configuration is lost through a reboot OR when the WAN interface disconnects and reconnected.

    This this a bug or am i missing something?

    Thanks

    Iain



  • What type of VIP are you creating? Are you sure the /32 is the correct mask for your 5 IPs?



  • The VIPs are of type IP Alias - Created in the firewall -> virtual ips screen.

    The primary ip address is assigned to the pppoe interface via DHCP and im not entirely sure what the correct mask would be.....

    The interface shows its ip address as /32

    I also tried /28, but this had the same result.

    The /32 works, but only if I run the command to add the address manually as above.

    Thanks



  • Ok - I've managed to find the line of code that issues the ipconfig command and "fix" the issue.....

    /etc/inc/interfaces.inc - line 2880.

    mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$vhid}");

    i'm not entirely sure what $vhid was supposed to be used for/set to - but it appears not to be set when that code runs.

    The "fix" was to add ppoe-isp-gw-ip after the alias parameter, so:

    mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias ppoe-isp-gw-ip {$vhid}");

    Now my vips are correctly set when the pppoe interface comes up and Openvpn can bind to the selected vip.

    Iain


Log in to reply