You are not logged in.
I have the following interfaces set up on my Arch Linux installation:
/etc/netctl/br0
Description="Static Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(enp0s25)
IP=static
Address='192.168.0.2/24'
Netmask='255.255.255.0'
Broadcast='192.168.0.255'
Gateway='192.168.0.1'
DNS=(removed)
SkipForwardingDelay=yes
/etc/netctl/br1
Interface=br1
Connection=bridge
IP=static
Address='10.0.0.2/24'
Netmask='255.255.255.0'
Routes=('10.0.0.3 via 10.0.0.3')
Broadcast='10.0.0.255'
SkipForwardingDelay=yes
Arch Linux is running on my host machine, and I have a Linux guest running inside it via QEMU. The host and guest use br0 to get to the internet (through my router with IP 192.168.0.1) and br1 is intended to be an internal private network between the host and guest.
My issue is that it appears that traffic between the host and guest is traveling out to the router and back again. I've tested this by running a high-traffic workload between my host and guest. When I manually disconnect the ethernet cable between the system and router, I see significantly improved network performance compared to when I plug it back in. Bmon also seems to agree that traffic never flows on the br1 interface.
How do I force all network traffic between the host and the guest to use br1/10.0.0.* when communicating with each other while still allowing both access to 192.168.0.* so they can both access the internet?
Offline
Best way to force your guest and host to use 10.0.0.0/24 subnet is to have only one bridge between them and use forwarding+masquerading for the internet access on guest.
Is this perhaps a laptop which will be moved around and you cannot rely on presence of external network at all times?
Approach that I would use:
1. Configure bridge with assigned IP address in the 10.0.0.0/24 subnet on host
2. Launch qemu with -net bridge,br=host_bridge_name
3. Configure guest interface with IP address in the 10.0.0.0/24 subnet
4. Check that both guest and host have routes for the 10.0.0.0/24 subnet using 'ip route'
Here check that host and guest can ping each other.
Steps to get internet connection on the guest:
5. Configure IP forwarding on host using 'sysctl'
6. Configure MASQUERADING on host using 'iptables'
7. On guest add host as default route - ip route add default via <host ip like 10.0.0.2> dev <guest interface like eth0>.
Offline
I have the following interfaces set up on my Arch Linux installation:
/etc/netctl/br0
Description="Static Bridge connection" Interface=br0 Connection=bridge BindsToInterfaces=(enp0s25) IP=static Address='192.168.0.2/24' Netmask='255.255.255.0' Broadcast='192.168.0.255' Gateway='192.168.0.1' DNS=(removed) SkipForwardingDelay=yes
Read man 5 netctl.profile. There is no Netmask= and Broadcast=.
/etc/netctl/br1
Interface=br1 Connection=bridge IP=static Address='10.0.0.2/24' Netmask='255.255.255.0' Routes=('10.0.0.3 via 10.0.0.3') Broadcast='10.0.0.255' SkipForwardingDelay=yes
Same remarks as above... Also, what do you want to say by your Routes=() parameter? it is supposed to be something like '10.0.0.0/24 via 10.0.0.1'. What's your gateway? Is it the host (= br1 = 10.0.0.2) or another VM (at 10.0.0.3)?
Arch Linux is running on my host machine, and I have a Linux guest running inside it via QEMU. The host and guest use br0 to get to the internet (through my router with IP 192.168.0.1) and br1 is intended to be an internal private network between the host and guest.
My issue is that it appears that traffic between the host and guest is traveling out to the router and back again. I've tested this by running a high-traffic workload between my host and guest. When I manually disconnect the ethernet cable between the system and router, I see significantly improved network performance compared to when I plug it back in. Bmon also seems to agree that traffic never flows on the br1 interface.
How do I force all network traffic between the host and the guest to use br1/10.0.0.* when communicating with each other while still allowing both access to 192.168.0.* so they can both access the internet?
So... read up on the "weak host model". But to the point: your br1 is not configured properly.
Also, what is the meaning by "internal pribvate network" if the guest is routing via 192.168.0.1? How do you invoke QEMU?
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline