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



  • I have what appears to be exactly the same problem.
    ppoe interface with a range of 8 IP addresses.
    Info from ISP:
    ####################
    Number of IP addresses: 8
    IP addresses: XXX.XXX.XXX.168 - XXX.XXX.XXX.175
    Subnet mask: 255.255.255.248
    Subnet in slash notation: XXX.XXX.XXX.168 /29
    Network address: XXX.XXX.XXX.168
    Broadcast address: XXX.XXX.XXX.175
    Router address: XXX.XXX.XXX.174
    Number of IP addresses usable by your hosts: 5
    ####################
    If I try and create a VIP's of .169 through to .173 on the interface with a /32 or /29 mask I get the same errors as the OP. Again similar to the OP I can manually create an alias to .168 and it works as expected but obviously lost on a reboot.

    Is this expected behaviour or am I doing something wrong?




Log in to reply