can't ping gateway


Forum: Networking
Topic: can't ping gateway
started by: lhoffmeyer

Posted by lhoffmeyer on Feb. 08 2006,23:06
Hey all,

Using embedded DSL in a WinXP host.  

I have static IP's.  
I am using a seperate static IP for DSL than for my Winxp.
I use netconfig to configure ETH0 but cannot connect to
internet.

I can ping 217.0.0.1
I can ping the static IP address
I cannot ping the gateway.

Any suggestions?

Lance

Posted by cbagger01 on Feb. 09 2006,04:25
Visit the QEMU web site help forums and learn more about how QEMU handles a simulated network connection between the virtual PC and the host computer's networking system.
Posted by lhoffmeyer on Feb. 09 2006,15:26
So,

I will need to "Bridge" the network since I am using embedded DSL in WinXP and
the network is static instead of DHCP?

If I were booting directly into DSL, no embedding, then the network card configuration would work?

If when using embedded DSL and the network is DHCP instead of static then
networking will work without bridging?

Lance

Posted by lhoffmeyer on Feb. 09 2006,18:09
So, I am attempting to bridge the network which I assume will allow me to
obtain internet access.

I setup the network parameters in /opt/bootlocal.sh
that I originally thought would work and didn't (IP address, Gateway ...)

then, I created the bridge script I found the QEMU forums but have now
realized that there is no ifrename in the DSL packages so this script will
not work.  Any suggestions/modifications to this that I can try?

Lance



#!/bin/sh

###############################################################################
#
# Setup a network bridge instead of the main network interface.
# This bridge can then be used to connect further (virtual) interfaces to the LAN, eg. Qemu's tap devices.
# Starting the bridge leads to ca. 5 seconds of "network unreachable".

# Network interface that shall be replaced by a bridge.
HOSTIF=eth0

#
###############################################################################


# Names used during bridge construction.
BRIF=br0
NEWHOSTIF=$BRIF$HOSTIF

# Check for root permissions
if [ `id -u` -gt 0 ]; then
   echo "Need root permissions to run."
   exit 1
fi

# Check for necessary tools
IFCONFIG=`which ifconfig`
IFRENAME=`which ifrename`
BRCTL=`which brctl`
IFUP=`which ifup`
IFDOWN=`which ifdown`

if [ -z $IFCONFIG ]; then
   echo "ifconfig not found (make sure this machine has networking, and ifconfig is in the path)"
   exit 127
fi

if [ -z $IFRENAME ]; then
   echo "ifrename not found (is package ifrename installed?)"
   exit 127
fi

if [ -z $BRCTL ]; then
   echo "brctl not found (is package bridge-utils installed?)"
   exit 127
fi

if [ -z $IFUP -o -z $IFDOWN ]; then
    echo "ifup/ifdown not found (is this not a Debian distro?)"
   exit 127
fi


# Main functionality
case "$1" in
   start)
       echo "Creating bridge $BRIF with $HOSTIF"

       # Deactivate current network setup
       $IFDOWN $HOSTIF
       $IFCONFIG $HOSTIF 0.0.0.0 down

       # Rename host interface
       $IFRENAME -i $HOSTIF -n $NEWHOSTIF

       # Create bridge
       $BRCTL addbr $HOSTIF
       $BRCTL stp $HOSTIF off
       $BRCTL setfd $HOSTIF 1
       $BRCTL addif $HOSTIF $NEWHOSTIF
       $BRCTL show

       # Activate bridge interfaces
       $IFCONFIG $HOSTIF up
       $IFCONFIG $NEWHOSTIF up

       # Configure new bridge to match old config
       echo "Configuring bridge $BRIF"
       $IFUP $HOSTIF
       ;;

   stop)
       echo "Removing bridge $BRIF which contains $NEWHOSTIF"

       # Deactivate interfaces
       $IFDOWN $HOSTIF
       $IFCONFIG $NEWHOSTIF down
       $IFCONFIG $HOSTIF down

       # Remove bridge
       $BRCTL delif $HOSTIF $NEWHOSTIF
       $BRCTL delbr $HOSTIF

       # Rename bridged interface to old name
       $IFRENAME -i $NEWHOSTIF -n $HOSTIF

       # Activate old network setup
       $IFCONFIG $HOSTIF up

       # Reconfigure network to match original network setup
       $IFUP $HOSTIF
       ;;

   status)
       $BRCTL show
       ;;

   *)
       echo "Usage: $0 [start|stop|status]"
       ;;
esac

exit 0

Posted by cbagger01 on Feb. 09 2006,18:13
When you boot directly into DSL, you can boot with the "nodhcp" command, IE:

dsl nodhcp

and then use the netcardconfig tool to set up your static ip address.  You can then use the /opt/bootlocal.sh script and the backup/restore process to save your network settings for your next reboot.

For embedded DSL, it is harder.  The QEMU folks have a better grip on the issues.

Posted by cbagger01 on Feb. 09 2006,18:44
FYI,

I am pretty sure that the QEMU batch file for DSL embedded choose "User Networking" instead of TAP networking, so you may need to edit the dsl-windows.bat file in order to get things to work.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.