Okay so I have setup so I can have an internal private network accept connections in and send connections out through a specific public IP in my block. (Seen in the config below)
I have two ip blocks and I want to use an ip from the other block, that block being the block the system was rented with (the main block) but for some reason I cannot get any IPs from the main block 69.x.x.x to work.
All the IPs in the 63.x.x.x block work fine with this config.
This is the config that does not work (The one attempting to use 69.*.*.205 in the same way)
I have two ip blocks and I want to use an ip from the other block, that block being the block the system was rented with (the main block) but for some reason I cannot get any IPs from the main block 69.x.x.x to work.
All the IPs in the 63.x.x.x block work fine with this config.
Code:
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
broadcast 69.*.*.207
network 69.*.*.200
auto vmbr0
iface vmbr0 inet static
address 69.*.*.202
gateway 69.*.*.201
netmask 255.255.255.248
bridge-ports eth0
bridge-stp off
bridge-fd 0
# 63.*.*.142 <-> 10.0.1.0
auto vmbr1
iface vmbr1 inet static
address 10.0.1.254
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
# Enable ip forwarding on the Host OS
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
# Create POST/PREROUTING rules on interface up
post-up iptables -t nat -A PREROUTING -s 10.0.1.0/24 -i vmbr0 -j DNAT --to 63.*.*.142
post-up iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -o vmbr0 -j SNAT --to-source 63.*.*.142
post-up iptables -t nat -A POSTROUTING -s '10.0.1.0/24' -o vmbr0 -j MASQUERADE
# Remove POST/PREROUTING rules on interface down
post-down iptables -t nat -D PREROUTING -s 10.0.1.0/24 -i vmbr0 -j DNAT --to 63.*.*.142
post-down iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -o vmbr0 -j SNAT --to-source 63.*.*.142
post-down iptables -t nat -D POSTROUTING -s '10.0.1.0/24' -o vmbr0 -j MASQUERADE
# Forward port 80 on public IP to 10.0.1.2
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.0.1.2:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.0.1.2:80
This is the config that does not work (The one attempting to use 69.*.*.205 in the same way)
Code:
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
broadcast 69.*.*.207
network 69.*.*.200
auto vmbr0
iface vmbr0 inet static
address 69.*.*.202
gateway 69.*.*.201
netmask 255.255.255.248
bridge-ports eth0
bridge-stp off
bridge-fd 0
# 69.*.*.205 <-> 10.0.1.0
auto vmbr1
iface vmbr1 inet static
address 10.0.1.254
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
# Enable ip forwarding on the Host OS
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
# Create POST/PREROUTING rules on interface up
post-up iptables -t nat -A PREROUTING -s 10.0.1.0/24 -i vmbr0 -j DNAT --to 69.*.*.205
post-up iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -o vmbr0 -j SNAT --to-source 69.*.*.205
post-up iptables -t nat -A POSTROUTING -s '10.0.1.0/24' -o vmbr0 -j MASQUERADE
# Remove POST/PREROUTING rules on interface down
post-down iptables -t nat -D PREROUTING -s 10.0.1.0/24 -i vmbr0 -j DNAT --to 69.*.*.205
post-down iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -o vmbr0 -j SNAT --to-source 69.*.*.205
post-down iptables -t nat -D POSTROUTING -s '10.0.1.0/24' -o vmbr0 -j MASQUERADE
# Forward port 80 on public IP to 10.0.1.2
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.0.1.2:80
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.0.1.2:80