Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Host network interface with three different public ip ranges for bridge
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Host network interface with three different public ip ranges for bridge

dongnedongne Member

I tried various settings but none worked.

I installed bridge-utils in devian 12:

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.33/31
gateway 192.168.1.32

auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
address 192.168.2.0/24

auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
address 192.168.3.0/24

Is this approach the right start? It did not work for me.

Thank you.

Comments

  • @dongne said:
    I tried various settings but none worked.

    I installed bridge-utils in devian 12:

    auto eth0
    allow-hotplug eth0
    iface eth0 inet static
    address 192.168.1.33/31
    gateway 192.168.1.32

    auto eth0:0
    allow-hotplug eth0:0
    iface eth0:0 inet static
    address 192.168.2.0/24

    auto eth0:1
    allow-hotplug eth0:1
    iface eth0:1 inet static
    address 192.168.3.0/24

    Is this approach the right start? It did not work for me.

    Thank you.

    No, this approach is not the right start. The configuration for assigning multiple public IP ranges to a network interface should be done using sub-interfaces or VLANs.

    Here is an example of how you can configure multiple public IP ranges on a network interface using sub-interfaces:

    auto eth0
    iface eth0 inet manual

    auto eth0.1
    iface eth0.1 inet static
    address 192.168.1.33
    netmask 255.255.255.254
    gateway 192.168.1.32

    auto eth0.2
    iface eth0.2 inet static
    address 192.168.2.1
    netmask 255.255.255.0

    auto eth0.3
    iface eth0.3 inet static
    address 192.168.3.1
    netmask 255.255.255.0

    In this configuration, eth0 remains as the main interface while eth0.1, eth0.2, and eth0.3 are sub-interfaces that represent the different public IP ranges.

    Restart the networking service or reboot the system after making these changes for them to take effect.

    Thanked by 1dongne
  • dongnedongne Member
    edited April 2

    I will try that out.

    *Btw this will be used to give each virtual machine a public ip address.

    Thank you

  • dongnedongne Member

    @greenhost_cloud said:

    @dongne said:
    I tried various settings but none worked.

    I installed bridge-utils in devian 12:

    auto eth0
    allow-hotplug eth0
    iface eth0 inet static
    address 192.168.1.33/31
    gateway 192.168.1.32

    auto eth0:0
    allow-hotplug eth0:0
    iface eth0:0 inet static
    address 192.168.2.0/24

    auto eth0:1
    allow-hotplug eth0:1
    iface eth0:1 inet static
    address 192.168.3.0/24

    Is this approach the right start? It did not work for me.

    Thank you.

    No, this approach is not the right start. The configuration for assigning multiple public IP ranges to a network interface should be done using sub-interfaces or VLANs.

    Here is an example of how you can configure multiple public IP ranges on a network interface using sub-interfaces:

    auto eth0
    iface eth0 inet manual

    auto eth0.1
    iface eth0.1 inet static
    address 192.168.1.33
    netmask 255.255.255.254
    gateway 192.168.1.32

    auto eth0.2
    iface eth0.2 inet static
    address 192.168.2.1
    netmask 255.255.255.0

    auto eth0.3
    iface eth0.3 inet static
    address 192.168.3.1
    netmask 255.255.255.0

    In this configuration, eth0 remains as the main interface while eth0.1, eth0.2, and eth0.3 are sub-interfaces that represent the different public IP ranges.

    Restart the networking service or reboot the system after making these changes for them to take effect.

    Not working 😔

  • vsys_hostvsys_host Member, Patron Provider

    You mentioned the bridge in your post but where is it in your config?
    Also, if you just want to configure multiple IPs on an interface, try the next way:
    auto eth0
    allow-hotplug eth0
    iface eth0 inet static
    address 192.168.1.33/31
    gateway 192.168.1.32

    iface eth0 inet static
    address 192.168.2.0/24

    iface eth0 inet static
    address 192.168.3.0/24

    Send here ip a output after applying if still not working.

  • pankaj05pankaj05 Member

    Firstly, ensure that the network interface (eth0) is properly configured and functioning. Check if the physical interface is up and connected to the network. You can use the command ip addr show eth0 to verify the interface's status and assigned IP address.

    Secondly, double-check the subnet masks you've used for each virtual interface (eth0:0 and eth0:1). The subnet mask should match the network's CIDR notation. For example, for the eth0:0 interface with the IP address 192.168.2.0, the subnet mask should be 255.255.255.0 (/24).

    Additionally, ensure that the gateway IP address specified in the configuration matches your network's gateway. The gateway IP should typically be on the same subnet as one of your IP addresses.

    Finally, after making any changes to the network configuration, it's essential to restart the networking service to apply the changes. You can do this by running sudo systemctl restart networking.service.

    If you've verified all these settings and are still experiencing issues, there might be other factors at play, such as firewall rules or routing configurations. Feel free to provide more details or logs if you need further assistance troubleshooting.

Sign In or Register to comment.