Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[geloest] notebook zu hause und auf der arbeit
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
tzzaetaynzz
Apprentice
Apprentice


Joined: 29 Sep 2003
Posts: 221

PostPosted: Tue Jan 13, 2004 9:52 pm    Post subject: [geloest] notebook zu hause und auf der arbeit Reply with quote

hallo an alle,

ich wandere mit meinem notebook zwischen arbeit und meinem zu hause hin und her.
jedesmal muss ich ipadresse, broadcast ... nameserver ... def-route ...
... naja, ihr wisst was ich meine - neusetzen.

gibt es eine moeglichkeit meinem notebook automatisch die daten zu kommen zu lassen
ohne das ich einen dhcp server zu hause betreibe?

gruss //tzzaetaynzz


Last edited by tzzaetaynzz on Tue Jan 13, 2004 10:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
Inte
Veteran
Veteran


Joined: 15 Jul 2003
Posts: 1387
Location: Mannheim, GER

PostPosted: Tue Jan 13, 2004 10:06 pm    Post subject: Reply with quote

Versuch's mal hier:Es gab - glaub' ich - noch ein paar mehr Tipps. Benutz einfach mal die Suchfunktion :wink:

Gruß, Inte.
_________________
Gentoo Linux - Die Metadistribution
Back to top
View user's profile Send private message
tzzaetaynzz
Apprentice
Apprentice


Joined: 29 Sep 2003
Posts: 221

PostPosted: Tue Jan 13, 2004 10:10 pm    Post subject: Reply with quote

Inte wrote:
Benutz einfach mal die Suchfunktion

habe ich doch getan ... :cry:
:D ... danke

gruss //tzzaetaynzz
Back to top
View user's profile Send private message
Inte
Veteran
Veteran


Joined: 15 Jul 2003
Posts: 1387
Location: Mannheim, GER

PostPosted: Tue Jan 13, 2004 10:15 pm    Post subject: Reply with quote

tzzaetaynzz wrote:
:D ... danke
:D Keine Ursache. So ein Danke motiviert ungemein.

Gruß, Inte.
_________________
Gentoo Linux - Die Metadistribution
Back to top
View user's profile Send private message
iBormuth
n00b
n00b


Joined: 13 Jan 2004
Posts: 59

PostPosted: Tue Jan 13, 2004 10:16 pm    Post subject: Reply with quote

Ich habe mir '/etc/init.d/net.home' und '/etc/init.d/net.work' geschrieben.

Beim booten wird automatisch das Netz gefunden, das erreichbar ist.

Code:

#!/sbin/runscript

depend() {
   use hotplug
}

start() {

   ebegin "start network for home"
        if [ -s /tmp/.net ]
        then
            eerror "HOME: /tmp/.net exists -- another networl configuration is active - stop it before using this one"
            return 1
        fi
#        /usr/bin/wwwoffle -off &> /dev/null       
      /sbin/ifconfig eth0 10.20.30.1 broadcast 10.20.30.255 netmask 255.255.255.0 >/dev/null || {
         eend 1 "could not use eth0"
            stop
         return 1
      }
   eend 0

    ebegin "  test network for home"
        ping -c 1 -W 4 10.20.30.254 &> /dev/null || {
            eend 1 "  could not connect gateway"
            stop
            return 1
        }
    eend 0

       
    ebegin "  set gateway for home"
    /sbin/route del default dev eth0 &>/dev/null
    /sbin/route add default gw 10.20.30.254 dev eth0 netmask 0.0.0.0 metric 1 >/dev/null || {
        eend 1 "  could not set gateway for home"
        stop
        return 1
    }
    eend 0


    ebegin "  set up DNS for home"
        echo "nameserver 10.20.30.254" > /etc/resolv.conf
    eend 0

    ebegin "  test DNS for home"
        ping -c 1 -W 4 efil.de &> /dev/null || {
            eend 1 "  could resolve URL"
            stop
            return 1
        }
    eend 0

#    ebegin "  putting wwwoffle to online mode"
#        /usr/bin/wwwoffle -on &> /dev/null
#    eend 0

    echo "net.home" > /tmp/.net
    say "You are at home."

     
   # Enabling rp_filter causes wacky packets to be auto-dropped by
   # the kernel.  Note that we only do this if it is not set via
   # /etc/sysctl.conf ...
   if [ -e /proc/sys/net/ipv4/conf/eth0/rp_filter ] && \
      [ -z "$(egrep '^[^#]*rp_filter' /etc/sysctl.conf 2>/dev/null)" ]
   then
      echo 1 > /proc/sys/net/ipv4/conf/eth0/rp_filter
   fi
}

stop() {
   ebegin "stop network: home"
#    /usr/bin/wwwoffle -off &> /dev/null
    /sbin/ifconfig eth0 down &> /dev/null
    rm -f /tmp/.net
   eend 0
}



Zum Umschalten sagst du einfach:

Code:

/etc/init.d/net.home stop
/etc/init.d/net.home start
/etc/init.d/net.work stop
/etc/init.d/net.work start


Was natürlich einer Tastenkombination im Window Manager zugeordnet ist.


Ich wollte das Script schon immer mal conf.d -fähig macher ....

Die aukommentierten Zeilen sogen dafür, daß man, falls kein Netz verfügbar ist, offline browsen kann.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
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