Ipfire vm has no internet

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? :slight_smile: Would be happy with all tips and hints!

Thanks!

can you post the routing table from the ipfire vm ?

Thanks for the answer!
you mean this?
image

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

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 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:

<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 :upside_down_face:… must ahve missed something again

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

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

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

1 Like

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)

2 Likes

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):

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

<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

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

I think the ipfire address should be 192.168.72.100 and gateway 192.168.72.1

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

1 Like

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):

sudo virsh net-dhcp-leases newredntw

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

<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.