Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Connecting 2 virtual machines to a single network

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
30 posts
  • Previous
  • 1
  • 2
Author
Message
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Dec 11, 2022 10:19 pm

Taigo,

There is no point in setting a default route for the 10.10.10.0/24 network. It may beak other things.

Set it up as I said then share the output of

Code: Select all

ifconfig
and

Code: Select all

route
from both VMs.
Also explain how you created the bridge and connected the VMs to it.

The default route belongs to the default set up on the other interfaces for now.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Taigo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 109
Joined: Wed Nov 09, 2022 8:42 pm
Location: the Netherlands
Contact:
Contact Taigo
Website

  • Quote

Post by Taigo » Sun Dec 11, 2022 10:56 pm

i set the up hopefully correct.
ifconfig: http://0x0.st/onsT.txt

route:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    1002   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     1002   0        0 eth0
192.168.112.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr1
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Dec 11, 2022 11:22 pm

Taigo,

This is the automatic virt-manager set up on the host.

Code: Select all

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:39:aa:f0  txqueuelen 1000  (Ethernet)
        RX packets 267  bytes 47532 (46.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 120  bytes 70659 (69.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Guests will use 192.168.122.1 as their default route.

Code: Select all

br0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether c6:0c:7d:b9:6f:c7  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
is the bridge I asked you to create.
Notice that it dos not have an IP address. That's correct.

Code: Select all

virbr1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.112.1  netmask 255.255.255.0  broadcast 192.168.112.255
        ether 52:54:00:97:2b:7f  txqueuelen 1000  (Ethernet)
        RX packets 8464  bytes 1471971 (1.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8213  bytes 135188562 (128.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
is in a name range that belongs to virt-manager.
It has an IP address of 192.168.112.1 on the host. What is that for.

The routing table looks correct.

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    1002   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     1002   0        0 eth0
192.168.112.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr1
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
Rules are applied from the bottom up. The kernel loots at the IP address in the packet, if it matches 192.168.122.0/24, its sent to virbr0. No other rools are tested.
When that fails, the packet is tested against 192.168.112.0/24, if it matches, the packet is sent to virbr1.
Anything eventually left over gets to the default, which matches everything, so packets the kernel cannot route are sent to 192.168.1.1 on eth0.

That's OK, now what of the two VMs?
When you set up the extra NICs in the VMs, connect them to br0.

What does

Code: Select all

route
and

Code: Select all

ifconfig
show for the two VMs?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Taigo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 109
Joined: Wed Nov 09, 2022 8:42 pm
Location: the Netherlands
Contact:
Contact Taigo
Website

  • Quote

Post by Taigo » Thu Dec 15, 2022 11:53 am

I am sorry for replying so late, i was a bit busy lately.
When you set up the extra NICs in the VMs, connect them to br0.

What does

Code: Select all

route
and

Code: Select all

ifconfig

show for the two VMs?
What do you mean with this? At the previous reply i also send route and ifconfig and both vm's where also connected to br0.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Dec 15, 2022 3:00 pm

Taigo,

You have three systems now.

1. The host
2. VM 1
3. VM 2

You posted the route and ifconfig from the host.
We need to see it from the two VMs too.

On windows, if you have windows installs in the two VMs, open the command prompt.
route works
ifconfig is ipconfig, as Microsoft used the BSD network code.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Post Reply

30 posts
  • Previous
  • 1
  • 2

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic