# Ipfire vm has no internet

**URL:** <https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897>\
**Category:** Installing & Running IPFire\
**Created:** [10 May 2022 17:28 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897 "2022-05-10T17:28:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![centauri](https://community.ipfire.org/user_avatar/community.ipfire.org/centauri/32/5550_2.png) [@centauri](https://community.ipfire.org/u/centauri)\
**Post date:** [10 May 2022 17:28 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/1 "2022-05-10T17:28:05Z")

</div>

Hi there!

Basically, I am trying out ipfire as a VM.  
Im running it with KVM on Fedora.  
Now I added a red network, NAT and two host-only networks for green and orange (I want to connect them to some other VMs later on). I configured the the red, green and organge network with some ip-ranges.  
When I check my the NICs and their ips (`ip -a`) I can see all nics have an ip. When I try to ping the ip of the red NIC from the host machine, I do recieve feedback. But when I log in to ipfire and try to ping google or something, it does not work: So I guess ipfire has no internet connection.  
Now: Im a beginner. I missed something obvious didn’t I? 🙂 Would be happy with all tips and hints!

Thanks!

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [10 May 2022 18:25 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/2 "2022-05-10T18:25:36Z")

</div>

can you post the routing table from the ipfire vm ?

---

<div class="post-metadata">

**Author:** ![centauri](https://community.ipfire.org/user_avatar/community.ipfire.org/centauri/32/5550_2.png) [@centauri](https://community.ipfire.org/u/centauri)\
**Post date:** [10 May 2022 19:06 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/3 "2022-05-10T19:06:48Z")

</div>

> [@anon42188109](#):
>
> outing table from the ipfire vm ?

Thanks for the answer!  
you mean this?  
 ![image](https://community.ipfire.org/uploads/default/original/2X/a/a18a40d5f906a0b55d52c8dd09b5280abfccfbaf.png)

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [10 May 2022 19:37 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/4 "2022-05-10T19:37:33Z")

</div>

Thank you for the output. `route -n` shows it in column format.

Could you configure red as DHCP so that it gets all info from the host network?

This link is for ubuntu but the concept is similar to Fedora.  
[https://help.ubuntu.com/community/KVM/Networking](https://help.ubuntu.com/community/KVM/Networking)

---

<div class="post-metadata">

**Author:** ![centauri](https://community.ipfire.org/user_avatar/community.ipfire.org/centauri/32/5550_2.png) [@centauri](https://community.ipfire.org/u/centauri)\
**Post date:** [10 May 2022 21:10 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/5 "2022-05-10T21:10:45Z")

</div>

> [@anon42188109](#):
>
> as DHCP so that it gets all info f

Thanks for help, I really appreciate it! Thanks for the command the link! Will test that now…

OK when I run the `setup` command in the VM again and set dhcp for the red network, ping is working. But it was my intention to set the red network statically. Looking at the link you send, I guess that is also what you meant.  
So based on your link and on [this one](https://computingforgeeks.com/managing-kvm-network-interfaces-in-linux/) I created the following nat-network with `virsh` that should work on the bridge virbr0 (i hope I got that right), it looks like this:

```auto
<network>
  <name>redntw</name>
  <uuid>bca37930-890a-44c4-85ef-6fbd16674d93</uuid>
  <forward dev='virbr0' mode='nat'>
    <interface dev='virbr0'/>
  </forward>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:2e:e9:82'/>
  <domain name='nat1'/>
  <ip address='192.168.72.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.72.1' end='192.168.72.254'/>
      <host name='ipfire' ip='192.168.72.100'/>
    </dhcp>
  </ip>
</network>   

```

but that does not give ipfire any internet 🙃… must ahve missed something again

mmm when I checked with ```route -n```` on my host machine I noted this:

```auto
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

```

so I guess, there might be something wrong with the bridge because it should deliver 192.168.72… checking

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [10 May 2022 21:18 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/6 "2022-05-10T21:18:44Z")

</div>

You’re missing the gateway info and also looking at the network configuration, you have range 72.1 - 72.254 but ipfire gets 72.100 If you want static, it should be outside that range. I have not worked with `virsh` so others in the know might chime in.

Found this link

> **[How to use bridged networking with libvirt and KVM](https://linuxconfig.org/how-to-use-bridged-networking-with-libvirt-and-kvm)**
>
> In this article we see how to use bridged networking with libvirt using a shared host physical interface

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [10 May 2022 21:39 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/7 "2022-05-10T21:39:53Z")

</div>

I took a screenshot of a test network. My host network is 10.\*, ipfire red got 10.0.0.14, gw is 10.0.0.1 and there is green and blue networks. `route -n` shows the gateway for red (see the G in Flags)

 ![Screenshot from 2022-05-10 14-33-41](https://community.ipfire.org/uploads/default/original/2X/b/b101369f066a44dce04add7d9b8e86f7d2ada682.png)

---

<div class="post-metadata">

**Author:** ![centauri](https://community.ipfire.org/user_avatar/community.ipfire.org/centauri/32/5550_2.png) [@centauri](https://community.ipfire.org/u/centauri)\
**Post date:** [10 May 2022 21:50 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/8 "2022-05-10T21:50:43Z")

</div>

Cool thanks a lot. I will try once more.

So far I managed this (with the flags like you indicated and I also set the gatway):

```auto
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.72.0 192.168.72.2 255.255.255.0 UG 1 0 0 virbr5

```

Netconfig

```auto
<network>
  <name>newredntw</name>
  <uuid>67516f22-233a-4bbc-9c7b-ff9dad0b5985</uuid>
  <forward mode='nat'/>
  <bridge name='virbr5' stp='on' delay='0'/>
  <mac address='52:54:00:b0:e5:82'/>
  <domain name='newredntw' localOnly='yes'/>
  <ip address='192.168.72.1' netmask='255.255.255.0' localPtr='yes'>
    <dhcp>
      <range start='192.168.72.101' end='192.168.72.254'/>
      <host name='ipfire' ip='182.168.72.100'/>
    </dhcp>
  </ip>
  <route address='192.168.72.0' prefix='24' gateway='192.168.72.2'/>
</network>

```

And this is how it looks like in ipfire:  
 ![image](https://community.ipfire.org/uploads/default/original/2X/0/0e4e056f63729dbd6628454c2d084aabc70bd6bb.png)

I have the feeling that Im close now. But Ipfire still has no internet 😉

---

<div class="post-metadata">

**Author:** ![anon42188109](https://community.ipfire.org/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@anon42188109](https://community.ipfire.org/u/anon42188109)\
**Post date:** [10 May 2022 22:55 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/9 "2022-05-10T22:55:42Z")

</div>

I think the ipfire address should be 192.168.72.100 and gateway 192.168.72.1

adjust the `<network> ... </network>` and try

---

<div class="post-metadata">

**Author:** ![centauri](https://community.ipfire.org/user_avatar/community.ipfire.org/centauri/32/5550_2.png) [@centauri](https://community.ipfire.org/u/centauri)\
**Post date:** [11 May 2022 08:31 UTC](https://community.ipfire.org/t/ipfire-vm-has-no-internet/7897/10 "2022-05-11T08:31:22Z")

</div>

Thanks! I changed Ip-address accordingly. If possible I would want to set a default gateway (I would need that for some assignment Im doing).

I used the following command (very nice and interesting):

```auto
sudo virsh net-dhcp-leases newredntw

```

It showed me, that the VM got a wrong IP. Found out I had a typo here:

```auto
<host name='ipfire' ip='182.168.72.100'/>

```

should have been **192** :

But dhcp ist giving the VM the IP ‘192.168.72.182’… which I dont understand yet. Should have some reason.
