User Tools

Site Tools


proxmox_one_ip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
proxmox_one_ip [2016/06/22 22:50] neoonproxmox_one_ip [2021/11/25 22:42] (current) – external edit 127.0.0.1
Line 26: Line 26:
     post-up iptables -t nat -A POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE      post-up iptables -t nat -A POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE 
     post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE     post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
 +Restart your Network:
 +  service networking restart
 +
 You also need to assign your VM's to vmbr2, example Network config for your VM's: You also need to assign your VM's to vmbr2, example Network config for your VM's:
  
Line 32: Line 35:
 IP: 10.21.21.4 IP: 10.21.21.4
  
-Restart your Network: /etc/init.d/networking restart+  allow-hotplug eth0 
 +  iface eth0 inet static 
 +        address 10.21.21.4 
 +        netmask 255.255.255.0 
 +        network 10.21.21.0 
 +        broadcast 10.21.21.255 
 +        gateway 10.21.21.254
  
 You can Forward one Port like this: You can Forward one Port like this:
  
-/sbin/iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1500 -j DNAT --to 10.21.21.4:22+  /sbin/iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1500 -j DNAT --to 10.21.21.4:22
  
 or a Port range like that: or a Port range like that:
  
-/sbin/iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1500:1600 -j DNAT --to 10.21.21.4+  /sbin/iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1500:1600 -j DNAT --to 10.21.21.4 
 + 
 +You can setup your own bash script with these commands and add it to the Startup: [[startup|Run a Script while Booting]] 
 + 
 +Or just put it into your Interfaces like that:
  
-You can setup your own bash script with these commands and add it to the Startup.+  auto vmbr2 
 +  iface vmbr2 inet static 
 +    address 10.21.21.254 
 +    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.21.21.0/24' -o vmbr0 -j MASQUERADE  
 +    post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE 
 +    post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.4:22 
 +    post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.4:22
  
proxmox_one_ip.1466632254.txt.gz · Last modified: 2021/11/25 22:43 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki