View previous topic :: View next topic |
Author |
Message |
appelgebak Apprentice
Joined: 12 Sep 2004 Posts: 225 Location: Ruhrpott
|
Posted: Sun Nov 28, 2010 2:29 pm Post subject: default gateway not set in bridge mode |
|
|
Hello,
using vbox on my gentoo machine bridged network is working proper from windows guest.
But from host-machine there is no internet-access, because the default gateway is not set:
When i start the network with /etc/init.d/network restart there is the following output:
Code: | localhost conf.d # /etc/init.d/network restart
* Stopping network [ ok ]
* Starting network [ ok ]
localhost conf.d # route
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 br0
loopback - 255.0.0.0 ! 0 - 0 -
localhost conf.d # ping www.heise.de
connect: Network is unreachable
localhost conf.d #
|
Result: Surfing with guest is possible, surfing from host not.
After that:
Code: | localhost conf.d # route add default gw 192.168.0.9
localhost conf.d # route
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 br0
loopback - 255.0.0.0 ! 0 - 0 -
default gate.local 0.0.0.0 UG 0 0 0 br0
localhost conf.d # ping www.heise.de
PING www.heise.de (193.99.144.85) 56(84) bytes of data.
64 bytes from www.heise.de (193.99.144.85): icmp_req=2 ttl=246 time=25.1 ms
64 bytes from www.heise.de (193.99.144.85): icmp_req=3 ttl=246 time=27.0 ms
64 bytes from www.heise.de (193.99.144.85): icmp_req=4 ttl=246 time=25.1 ms
64 bytes from www.heise.de (193.99.144.85): icmp_req=5 ttl=246 time=24.6 ms
^C
--- www.heise.de ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4005ms
rtt min/avg/max/mdev = 24.603/25.475/27.020/0.918 ms
|
My /etc/conf.d/net looks like this (at the end you can see several tries to set the gateway...):
Code: | # /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $
# Global config file for net.* rc-scripts
# This is basically the ifconfig argument without the ifconfig $iface
#
#config_eth0=( "192.168.0.1/24 brd 192.168.0.255" )
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."
# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"
# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
#################################################
##############################################
#####################################
# For every VM create an interface,
# set user to the one who going to use the
# interface.
tuntap_vbox0="tap"
tunctl_vbox0="-u bede"
config_vbox0="null"
config_eth0="null"
# Add here all interfaces that you want to bridge
# eg eth0, but make sure to add config_eth0="null"
rc_need_br0="net.vbox0"
bridge_br0="vbox0 eth0"
# The following will be the host IP, it can be the default router
# for the VM in routing mode.
# You can use dhcp here if you like, it makes sense if you want
# to bridge your VM into the real network.
#config_br0="dhcp"
#config_br0="192.168.0.1/24"
config_br0=( “192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255″ )
brctl_br0="setfd 0
sethello 0
stp off"
#gateway="br0/192.168.0.9"
#routes_br0=( "192.168.0.9")
#routes_br0=("default via 192.168.0.9")
routes_br0=( "default gw 192.168.0.9" )
|
My host ip is 192.168.0.1, gateway and dns is 192.168.0.9, vbox-machine is 192.168.0.99
Kernel is 2.6.36
Any help is welcome...
Appel |
|
Back to top |
|
|
DawgG l33t
Joined: 17 Sep 2003 Posts: 874
|
Posted: Tue Nov 30, 2010 12:24 pm Post subject: |
|
|
Code: | #routes_br0=("default via 192.168.0.9")
routes_br0=( "default gw 192.168.0.9" ) |
looks like a small typo, second line should read:
routes_br0=( "default via 192.168.0.9" )
GOOD LUCK! _________________ DUMM KLICKT GUT. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|