Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with using an initscript to start a bridge.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Royle
Apprentice
Apprentice


Joined: 21 Jul 2004
Posts: 223

PostPosted: Sat Dec 11, 2004 1:56 pm    Post subject: Help with using an initscript to start a bridge. Reply with quote

Ok so I use a networking bridge to bridge two ethernet cards on this computer. Everytime I boot this computer I have to do it again. I tried creating an initscript to take care of this but it seems to be running too early in the boot process.
Code:
#!/sbin/runscript

depend() {
        use logger dns
        need net
        after net.eth1
        after net.eth0
        after net.lo
}

start() {
        ebegin "starting bridge br0"
        /sbin/brctl addbr br0
        /sbin/brctl addif br0 eth0
        /sbin/brctl addif br0 eth1
        ifconfig br0 up
        dhcpcd br0
}

stop() {
        ebegin "bringing down br0"
        ifconfig br0 down
}

Also rc-update show returns this:
Code:
 alsasound | boot                         
            bootmisc | boot                         
                 br0 |                               
              bridge |                               
             bridge1 |                               
            bridge1~ |                               
             checkfs | boot                         
           checkroot | boot                         
               clock | boot                         
         consolefont | boot                         
         crypto-loop |                               
               cupsd |                               
          domainname |      default                 
              esound |                               
                famd |                               
                 gpm |                               
              hdparm |                               
            hostname | boot                         
             keymaps | boot                         
               local |      default nonetwork     
          localmount | boot                         
             modules | boot                         
            net.eth0 |      default                 
            net.eth1 |      default                 
              net.lo | boot                         
            netmount |      default                 
                nscd |                               
             numlock |                               
             portmap |                               
           rmnologin | boot                         
              rsyncd |                               
               samba |                               
              serial | boot                         
                sshd |                               
            sysklogd |                               
             urandom | boot                         
          vixie-cron |      default                 
                 xdm |                               
                 xfs |                               



Does anyone know what I'm doing wrong?
Back to top
View user's profile Send private message
siro
Tux's lil' helper
Tux's lil' helper


Joined: 20 Mar 2004
Posts: 102

PostPosted: Sat Dec 11, 2004 2:33 pm    Post subject: Reply with quote

why do you think it is running too early? do you get any error messages that make you think that?

For the text you pasted it seems you didnt add your script to any runlevel, to add it to the default runlevel just do "rc-update add br0 default" (if br0 is your init script).

If you already did that please post some more output, post what you get after ifconfig and after booting (maybe one of those [!!]s on startup).


Last edited by siro on Sat Dec 11, 2004 5:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
Royle
Apprentice
Apprentice


Joined: 21 Jul 2004
Posts: 223

PostPosted: Sat Dec 11, 2004 5:31 pm    Post subject: Reply with quote

no there is no error, it just runs the script, then afterwards other networking scripts run. Also with the text I posted without the script set, I removed it because it took a long time for it to run and it never worked.
Back to top
View user's profile Send private message
siro
Tux's lil' helper
Tux's lil' helper


Joined: 20 Mar 2004
Posts: 102

PostPosted: Sat Dec 11, 2004 6:08 pm    Post subject: Reply with quote

What runlevel where you adding your script to? It should be default, if you add it to boot it will start before the other net scripts as they are in default.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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