Interface as a default gateway

Tom H tomh0665 at gmail.com
Sun Mar 15 01:41:44 UTC 2015


On Sat, Mar 14, 2015 at 6:41 PM, Karl Auer <kauer at biplane.com.au> wrote:
> On Sat, Mar 14, 2015 at 10:01 AM, Amer <amer7777 at hotmail.com> wrote:
> On Sat, 2015-03-14 at 11:06 -0400, Tom H wrote:


>> 1) It would have to be "ip r add 0.0.0.0/0 via ip_add_of_eth0 dev eth0".
>
> The address may not be needed. That is "ip r add 0.0.0.0/0 dev eth0" may
> also work. I'm not sure with a virtual network.

I screwed up.

I meant to "ip r add 0.0.0.0/0 via ip_add_of_gateway dev eth0"


>> 2) IIRC you've used VB's bridged network mode. Again IIRC because I haven't
>> used VB in a while, that means that if your host has, eg, a 192.168.1.x
>> address, your VM'll have a 192.168.1.y address. So the gateway has to be
>> the same as the host's and not the host's ip address.
>
> With bridged interfaces, there is no requirement for the VM interfaces
> to have addresses in the same networks as the host interfaces do. It's
> OK to have (say) 192.168.100.00/24 on the VM interfaces and (say)
> 192.168.200.0/24 on the host interfaces. Or even have NO addresses on
> the host interfaces. However, if you actually want to *reach* the VM
> interfaces, obviously they have to have addresses in reachable networks.

Of course. I use qemu/kvm on my laptop; and it uses 192.168.1.11 and
my VMs use 10.0.2.xy. If I could add my wlan0 to my bridge, I'd use
192.168.1.xy for mv VMs too. I have "ip r ..." and "iptables ..." that
allow me to access my VMs from my laptop and from my lan (in the
latter case if I set a route to 10.0.2.0 via my laptop's address on
whatever system that I'm using).

As I said, I haven't used VB in a while but I remember that there was
a "bridged" setting that I used to use whereby VB seemed to create a
bridge and add wlan0 to it, and the VMs had addresses in the same
subnet as my lan.




More information about the ubuntu-users mailing list