Howdy, Stranger!

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


Proxmox NAT Php_friends, LXC Works, KVM didn't
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.

Proxmox NAT Php_friends, LXC Works, KVM didn't

akhfaakhfa Member
edited March 2019 in Help

Dear all, I need some help for this

I bought server from php-friends https://www.lowendtalk.com/discussion/156207/2-dedicated-cores-10-gb-ram-40-gb-ssd-2tb-1-gbit-s-for-6-month/p1

And then I install proxmox from debian 9.5 template. I have /etc/network/interface below

auto lo
iface lo inet loopback

# Already exist from phpfriend template
auto eth0
iface eth0 inet static
        address  x.x.x.x
        netmask  255.255.255.0
        gateway  x.x.x.x
        dns-nameservers x.x.x.x
        up ip addr add x:x:x:x/64 dev eth0
        up ip -6 route add x:x:x:x dev eth0
        up ip -6 route add default via x:x:x:x

# Additional NAT bridge I want to add
auto vmbr1
iface vmbr1 inet static
        address  10.20.30.1
        netmask  255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE

I add guest config below, both for KVM and LXC

IP: 10.20.30.3
NETMASK: 255.255.255.0
GATEWAY: 10.20.30.1

Configuration above works for LXC with centos template, but it didn't work for KVM. I also read https://www.lowendtalk.com/discussion/comment/2822339/#Comment_2822339 and I think my config should be okay. Am I miss something?

Thank you.

Comments

  • ehabehab Member
    edited March 2019

    this works for me

    auto lo
    iface lo inet loopback
    
    iface ens3 inet manual
    
    auto vmbr0
    iface vmbr0 inet static
        address x.x.x.y
        netmask 255.255.255.0
        gateway x.x.x.1
        bridge_ports ens3
        bridge_stp off
        bridge_fd 0
    
    auto vmbr1
    iface vmbr1 inet static
            address 10.0.0.1
            netmask 255.255.255.0
            bridge_ports vmbr0
            bridge_stp off
            bridge_fd 0
            post-up   iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
            post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
    

    in your vm's use vmbr1 as the bridge - you may need to reboot all your pc's
    and
    laptops
    and
    you mobiles
    and
    :)

    Thanked by 2Ympker akhfa
  • FalzoFalzo Member

    did you check for the naming of the network device in your kvm guest? what OS did you install and how (netinst etc.?)

    Thanked by 1Ympker
  • @akhfa said:
    Dear all, I need some help for this

    I bought server from php-friends https://www.lowendtalk.com/discussion/156207/2-dedicated-cores-10-gb-ram-40-gb-ssd-2tb-1-gbit-s-for-6-month/p1

    And then I install proxmox from debian 9.5 template. I have /etc/network/interface below

    > auto lo
    > iface lo inet loopback
    > 
    > # Already exist from phpfriend template
    > auto eth0
    > iface eth0 inet static
    >         address  x.x.x.x
    >         netmask  255.255.255.0
    >         gateway  x.x.x.x
    >         dns-nameservers x.x.x.x
    >         up ip addr add x:x:x:x/64 dev eth0
    >         up ip -6 route add x:x:x:x dev eth0
    >         up ip -6 route add default via x:x:x:x
    > 
    > # Additional NAT bridge I want to add
    > auto vmbr1
    > iface vmbr1 inet static
    >         address  10.20.30.1
    >         netmask  255.255.255.0
    >         bridge-ports none
    >         bridge-stp off
    >         bridge-fd 0
    >         post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    >         post-up iptables -t nat -A POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE
    >         post-down iptables -t nat -D POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE
    > 

    I add guest config below, both for KVM and LXC

    > IP: 10.20.30.3
    > NETMASK: 255.255.255.0
    > GATEWAY: 10.20.30.1
    > 

    Configuration above works for LXC with centos template, but it didn't work for KVM. I also read https://www.lowendtalk.com/discussion/comment/2822339/#Comment_2822339 and I think my config should be okay. Am I miss something?

    Thank you.

    Memorable ip

  • akhfaakhfa Member

    @ehab said:
    this works for me


    auto lo
    iface lo inet loopback

    iface ens3 inet manual

    auto vmbr0
    iface vmbr0 inet static
    address x.x.x.y
    netmask 255.255.255.0
    gateway x.x.x.1
    bridge_ports ens3
    bridge_stp off
    bridge_fd 0

    auto vmbr1
    iface vmbr1 inet static
    address 10.0.0.1
    netmask 255.255.255.0
    bridge_ports vmbr0
    bridge_stp off
    bridge_fd 0
    post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr0 -j MASQUERADE

    in your vm's use vmbr1 as the bridge - you may need to reboot all your pc's
    and
    laptops
    and
    you mobiles
    and
    :)

    Hi Ehab,

    After I reboot the host server with my initial config, finally it works :hushed:
    Thank you! :smiley:

    I have 2 question here:
    1. After I edit /etc/network/interface, I always systemctl restart networking. What is the different with full reboot on host node?
    2. You have iface ens3 inet manual (create new vmbr0 for the public IP) and I have iface eth0 inet static (without creating vmbr0 for public IP), what is the different? Long time ago I also use vmbr0 with public IP, but for now I don't create it because I think they are same.

    @Falzo said:
    did you check for the naming of the network device in your kvm guest? what OS did you install and how (netinst etc.?)

    Hi Falzo, thank you for your comment on every (or nearly all) of proxmox thread that need help, but it seems that @ehab is quicker today :smiley:

    @uxtvdl said:
    Memorable ip

    Do you mean 10.20.30.0 ? :wink:

    Thanked by 1Falzo
  • ehabehab Member
    1. i think promox has a network temp file and that gets applied after reboot... i can be wrong here.

    2. its just name

    Falzo is the master

    Thanked by 1Falzo
  • FalzoFalzo Member

    akhfa said: 1. After I edit /etc/network/interface, I always systemctl restart networking. What is the different with full reboot on host node?

    think about it that way: a 'restart' of the network tries to unload the network configuration based on the configs. so if you changed something (manually), that restart might not be able to remove everything old from the IP/route settings correctly, because it simply lacks all the informations.
    as a result applying the new settings might also not work completly because of things that are stuck or not fully unloaded.

    a reboot instead really loads everything for the network from scratch without orphaned stuff in the tables ;-)

    ehab said: i think promox has a network temp file and that gets applied after reboot... i can be wrong here.

    that's true, at least if you change the settings via the proxmox control panel

    Thanked by 1akhfa
  • Vova1234Vova1234 Member, Patron Provider

    Proxmox VM on VPS VM? What's the point of this?

  • Memorable ip

    Do you mean 10.20.30.0 ?

    yes

  • akhfaakhfa Member

    @Vova1234 said:

    Proxmox VM on VPS VM? What's the point of this?

    Splitting service, 1 service on 1 VM, and more easy to setup full disk encryption from proxmox VNC. Somehow I can't load iso from php friends panel and I'm too lazy to open ticket :wink:

    Actually I prefer using docker, but I need the full disk encryption, and also my service comes with autoinstaller script to install from scratch and I don't have time to custom the script so that 2 service can be deployed in one VM :smiley:

    From security perspective I think it also good to have 1 public IP to keep than I separate my service into 2 vps with public IP for each of them

    @uxtvdl said:

    Memorable ip

    Do you mean 10.20.30.0 ?

    yes

    Just adopt it :wink:

  • ehabehab Member

    @Vova1234 said:
    Proxmox VM on VPS VM? What's the point of this?

    do you know of a better "easy" ui to manage lxc's or kvm's.

  • Vova1234Vova1234 Member, Patron Provider
    edited March 2019

    ehab said: do you know of a better "easy" ui to manage lxc's or kvm's.

    For KVM, it's easier for me to do on vmmanager 5 kvm. I can work with ProxMox and writes the manuals on the my site.

    It is not the panel that surprises me, but the server under the panel surprises me.

    Installing proxmox on vServer: https://php-friends.de/vserver-ssd/vserver-fruehlingsspecial-2019-ssd
    This is how to put a VPS panel on a VPS to cut a VPS.

    Thanked by 1ehab
  • ehabehab Member

    i didn't know about vmmanager before. i will not pay unless i am doing business.

  • virt-install

  • NeoonNeoon Community Contributor, Veteran

    Let me know the performance of the KVM inside a KVM with 1500 benchmark.

  • ehabehab Member

    @Neoon said:
    Let me know the performance of the KVM inside a KVM with 1500 benchmark.

    in your opinion what is the minimum?

  • NeoonNeoon Community Contributor, Veteran

    @ehab said:

    @Neoon said:
    Let me know the performance of the KVM inside a KVM with 1500 benchmark.

    in your opinion what is the minimum?

    Well, first you have the overhead since KVM in KVM.
    Second, I would not go below 3k benchmark or 8gig of memory to run any KVM's on it.

    Sure it works but meh, the speeds wont be that good.

    Thanked by 2ehab vimalware
  • akhfaakhfa Member

    @Neoon said:
    Let me know the performance of the KVM inside a KVM with 1500 benchmark.

    What benchmark script do you want to run?

Sign In or Register to comment.