Hi
Can anyone please suggest the issue with my config.
I am trying to do a setup where my host has a public and private ip.
All vm's are to have a private ip only.
Of cousre the vm's should be abe to connect to the internet.
I have the config below
My vm has ip 10.0.0.100.
My host has a public ip and private ip. The private ip is 10.0.0.254.
Host is able to ping the vm.
vm is able to ping the private ip of host.
Why can't the vm ping public ip's?
---------------------------------------------------
HOST
Contents of the file: /etc/network/interfaces
auto vmbr1
iface vmbr1 inet static
address 10.0.0.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.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
---------------------------------------------------
VM
Contents of the file: /etc/sysconfig/network-scripts/ifcfg-ens18
DEVICE=ens18
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
IPV6INIT=no
IPADDR=10.0.0.100
GATEWAY=10.0.0.254
NETMASK=255.255.255.0
ARP=yes
======================================================================================
Can anyone please suggest the issue with my config.
I am trying to do a setup where my host has a public and private ip.
All vm's are to have a private ip only.
Of cousre the vm's should be abe to connect to the internet.
I have the config below
My vm has ip 10.0.0.100.
My host has a public ip and private ip. The private ip is 10.0.0.254.
Host is able to ping the vm.
vm is able to ping the private ip of host.
Why can't the vm ping public ip's?
---------------------------------------------------
HOST
Contents of the file: /etc/network/interfaces
auto vmbr1
iface vmbr1 inet static
address 10.0.0.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.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
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 188.164.246.254 0.0.0.0 UG 0 0 0 eno1
0.0.0.0 188.164.246.254 0.0.0.0 UG 0 0 0 vmbr0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 vmbr1
188.164.246.0 0.0.0.0 255.255.255.0 U 0 0 0 eno1
188.164.246.0 0.0.0.0 255.255.255.0 U 0 0 0 vmbr0
---------------------------------------------------
VM
Contents of the file: /etc/sysconfig/network-scripts/ifcfg-ens18
DEVICE=ens18
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
IPV6INIT=no
IPADDR=10.0.0.100
GATEWAY=10.0.0.254
NETMASK=255.255.255.0
ARP=yes
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.254 0.0.0.0 UG 0 0 0 ens18
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens18
======================================================================================