how to both bridge and nat network

Discussion in 'Proxmox VE: Networking and Firewall' started by klinutzu, Jan 26, 2018.

  1. klinutzu

    klinutzu New Member

    Joined:
    Jan 26, 2018
    Messages:
    1
    Likes Received:
    0
    hello, i have a proxmox installation with public ip and several public IP's on vm's, but i need 2 more vm's and don't have any more public IP so i want to use both bridge mode with nat mode in same time. it's possible or not? thx
     
  2. wolfgang

    wolfgang Proxmox Staff Member
    Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    4,076
    Likes Received:
    251
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MikeWebb

    MikeWebb New Member

    Joined:
    Sep 16, 2018
    Messages:
    5
    Likes Received:
    0
    Yeah that seemed like a bit of a throw away comment. I've hit this same issue and have read through the admin-guide and found it hard to abstract an answer from it. I ended up enabling sr-iov on my card and and bridging and NATing on different VF's.

    I later found this but haven't confirmed it to work but it looks sane to me:

    Code:
    auto lo
    iface lo inet loopback
    
    iface eth0 inet manual
    
    auto vmbr0
    iface vmbr0 inet static
    address 79.x.x.x
    netmask 255.255.255.0
    gateway 79.x.x.x
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    
    auto vmbr1
    iface vmbr1 inet static
    address 10.10.10.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.10.10.0/24' -o vmbr0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADEWould this be okay?
    https://forum.proxmox.com/threads/proxmox-ve-nat-and-bridge-with-1-physical-interface.16710/
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice