Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> VM can't connect to internet
defau1t
 Posted: Oct 28 2013, 10:55 PM
Quote Post


SLF Newbie


Group: Members
Posts: 7
Member No.: 885
Joined: 30-September 11









I have a VM on the default network (192.168.122.x) that can connect fine to the internet, but the VM on the "outsider" network (192.168.100.x) will not connect to the internet.

Both Virtual Networks are set to NAT. I can ping both VMs from the host machine, as well as ping the host machine from each VM. The "outsider" VM can ping the default VM, but the default VM cannot see the "outsider" VM. Is this expected behavior? I'm very new to networking.
PM
^
defau1t
 Posted: Nov 2 2013, 10:04 PM
Quote Post


SLF Newbie


Group: Members
Posts: 7
Member No.: 885
Joined: 30-September 11









So after some researching, I found out that I needed to setup IP forwarding on the host system.

1. Change "net.ipv4.ipforward = 0" to "net.ipv4.ipfoward = 1" in /etc/sysctl.conf, reboot
2. Enable routing through the firewall with:
CODE
#iptables -A FORWARD -o wlan0 -j ACCEPT
#iptables -A FORWARD -o virbr0 -j ACCEPT
#iptables -A FORWARD -o virbr1 -j ACCEPT

3. And lastly, if you want to connect to the internet, the VM needs to have the DNS set to the DNS server IP address used on the local network (you can modify /etc/resolv.conf but that will not survive a reboot).
PM
^
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll