[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [NOVICE] Min Linux kan ikke se netværket



Jens Bang wrote:


> Min ser sådan ud:
> 
> ---------- start fil ----------
> #!/bin/sh
> 
> cat /proc/net/dev |grep : | cut -d : -f 1 | grep lo >/dev/null 2>&1
> 
> if [ $? -eq 0 ] ; then
>     ifconfig lo 127.0.0.1
>     route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
> fi
> 
> IPADDR=192.168.42.2
> NETMASK=255.255.255.0
> NETWORK=192.168.42.0
> BROADCAST=192.168.42.0
> GATEWAY=192.168.42.1
> 
> cat /proc/net/dev |grep : | cut -d : -f 1 | grep eth0 >/dev/null 2>&1
> 
> if [ $? -eq 0 ] ; then
>     ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
>     route add -net ${NETWORK} netmask ${NETMASK} dev eth0
>     [ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1
> fi
> ---------- slut fil ----------

Ok den opsætter eth0 og "lo" (localhost/loopback)


Stort set det samme som mine ifconfig/routes laver.
Parametrene er blot sat op i variable før brug.


> >#!      /bin/sh
> >ifconfig lo 127.0.0.1
> >route add -net 127.0.0.0 lo
> 
> Hvad gør de to linier?

Initialiserer loopback device (127.0.0.1). Skal helst være
der på en unix box (eller anden box med tcp/ip)

> ># Network route for ethernet
> >ifconfig eth0 192.168.1.1 up
> 
> 'Starter' dit netkort?

initialiserer tcp/ip stak på eth0 (netkort) 

> 
> >route add -net 192.168.1.0 netmask 255.255.255.0 eth0
> 
> Sætter din maskine op til hvad der skal gå gennem gateway'en?

fortæller at alle pakker der matcher "192.168.1.x" skal
sendes gennem eth0.


....

> Det opdagede jeg. Skal jeg så bare indsætte
> 
>      ifconfig eth0 192.168.42.2 netmask 255.255.255.0 up
> 
> i min network fil?

Nej i dit tilfælde anvender du:

> IPADDR=192.168.42.2
> NETMASK=255.255.255.0
> NETWORK=192.168.42.0
> BROADCAST=192.168.42.0
> GATEWAY=192.168.42.1

Dog GATEWAY anvendes kun hvis alt trafik skal igennem eth0,
og du ikke anvender PPP til internet.


....

> >jeg har det i /etc/init.d/network
> >(men måske ikke det korrekte sted, men det virker hos mig)
> 
> OK, hvis det virker, så er det vel en god start.  :-)

Du kan med "ifconfig" og "route -n" checke at eth0 er blevet
sat op med passende route.


-- 
mvh Frank Damgaard  sslug@sslug | sslug@sslug |fido  2:236/15.2


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:57 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *