# configure baselayout to use dhcpcd AND adsl? (solved)

## tecknojunky

Basically, I want a dhcpcd process that will start a script when the ip is renewed on my pppoe connection.

I tried this, which will bring the adsl up with an ip, but no dhcpcd process is running after...

```
config_eth0=( "192.168.1.1/24" )

config_eth1=( "10.0.0.1" )

dhcpcd_ppp0="-c /etc/ppp/dhcpcd.new"

config_eth1=( "adsl" )

adsl_user_eth0="someone@some.place"
```

I tried adding a config_ppp0( "dhcp" ) in there but all it did was to scrap my options file and broke the connection (or was it running net.ppp0 start?).

----------

## UberLord

Any reason why you can't put your script in /etc/ppp/ip-up.local?

As that gets called every time ppp gets an ip ...   :Wink: 

EDIT: Correct script path

----------

## tecknojunky

The reason is that I did not know that.  :Rolling Eyes: 

So, I emerged dhcpcd for nothing, it seems.  :Laughing: 

Thanks.  I had no clue it could be so obvious.

Say UberLord, is there a current documentation about baselayout, or is all of it in /etc/conf.d/net?  Althought it maybe covers it all, it is skinny.  I'd appreciate a more academic/tutorial approach to the doc, even a skinny one.

See, another question I was asking myself... I see their are provisions for alternate routes in the dialect of your abstraction layer.  I was wondering if that could be used for a dialup link in case the adsl goes down?

Thanks for the tip about ip-up.local.  I will test it today (I'm just waking up).

I kneel before the UberLord  :Very Happy: 

----------

## UberLord

 *tecknojunky wrote:*   

> Say UberLord, is there a current documentation about baselayout, or is all of it in /etc/conf.d/net?  Althought it maybe covers it all, it is skinny.  I'd appreciate a more academic/tutorial approach to the doc, even a skinny one.

 

/etc/conf.d/net.example is the master guide, written by me

Also by me - the handbook network section http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4 (only applies to stable baselayouts)

 *Quote:*   

> See, another question I was asking myself... I see their are provisions for alternate routes in the dialect of your abstraction layer.  I was wondering if that could be used for a dialup link in case the adsl goes down?

 

With baselayout-1.12.0_pre11-r3 you can use the new pppd module which is going to replace the current adsl module. It's harder to setup (but not much), but it works with the kernel PPPoE/PPPoA module which is much faster and a bit more reliable (ie, I can get it working!). Using this, you then get the full baselayout networking feature set which you don't get with the adsl module.

I'm not sure if that really answers your question though as it's not too clear ..... well, not to me anyway  :Confused: 

 *Quote:*   

> I kneel before the UberLord 

 

You can lick my boots clean while you're down there   :Laughing:   :Twisted Evil:   :Laughing: 

----------

## tecknojunky

 *UberLord wrote:*   

> ... http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4 (only applies to stable baselayouts)

 Good enough.

 *UberLord wrote:*   

>  *tecknojunky wrote:*   See, another question I was asking myself... I see their are provisions for alternate routes in the dialect of your abstraction layer.  I was wondering if that could be used for a dialup link in case the adsl goes down? 
> 
> With baselayout-1.12.0_pre11-r3 you can use the new pppd module which is going to replace the current adsl module. It's harder to setup (but not much), but it works with the kernel PPPoE/PPPoA module which is much faster and a bit more reliable (ie, I can get it working!). Using this, you then get the full baselayout networking feature set which you don't get with the adsl module.
> 
> I'm not sure if that really answers your question though as it's not too clear ..... well, not to me anyway 

 I'm already using the pppoe kernel module, so that part is covered.

I just want a failover link in case the pppoe/adsl link goes down.  If I would had total control of the scripts, I might be able to pull it off, but thrue the baselayout that's another ball game since pppoe and dialup both uses ppp and they must not conflict which each other.

This feature is not as important as updating my dns when the IP change.  Eventualy, I will get static IP and pay for two different ISP doing round-robin.  All that will be missing is a engine generator to get 100% connectivity.  :Very Happy: 

 *UberLord wrote:*   

>  *tecknojunky wrote:*   I kneel before the UberLord  
> 
> You can lick my boots clean while you're down there    

 

Yes sir!  :Very Happy:  (Lick!  Lick!  Spit!  Shine.  Squeeky!  Sparkle!)

----------

## UberLord

 *tecknojunky wrote:*   

> I just want a failover link in case the pppoe/adsl link goes down.  If I would had total control of the scripts, I might be able to pull it off, but thrue the baselayout that's another ball game since pppoe and dialup both uses ppp and they must not conflict which each other.

 

You can net.ppp0 and net.ppp1 (both linked to net.lo using baselayout-1.12.0_pre11-r3) are seperate and can active indepently of each other. This is achieved by using the linkname pppd parameter.

However we provide no facility to say "if ppp0 failed then start ppp1". Well actually we do, we call the failup function if we failed to come up in /etc/conf.d/net

```

failup() {

   if [[ ${IFACE} == "ppp0" ]]; then

      /etc/init.d/net.ppp1 start

   fi

}
```

Of course, you don't want to add if $IFACE == ppp1 then start ppp0 as you could get an infinite loop if both failed.

 *Quote:*   

>  *UberLord wrote:*    *tecknojunky wrote:*   I kneel before the UberLord  
> 
> You can lick my boots clean while you're down there     
> 
> Yes sir!  (Lick!  Lick!  Spit!  Shine.  Squeeky!  Sparkle!)

 

Cool, I can see my face in them! Might fine job there tecknojunky    :Very Happy: 

----------

## tecknojunky

 *UberLord wrote:*   

> Any reason why you can't put your script in /etc/ppp/ip-up.local?
> 
> As that gets called every time ppp gets an ip ...  

 

I had put a sendmail command inside /etc/ppp/ip-up.local that mails to me.  Calling the script from the command line works.  Today, the ppp IP changed, but there were no mail sent.  So, it would seem /etc/ppp/ip-up.local does not get called every time ppp gets a new ip.  :Sad: 

----------

## UberLord

Well, that's a pppd bug then. Go bug the maitainer (mrness) on irc or open a bug!

----------

## tecknojunky

 *UberLord wrote:*   

> Well, that's a pppd bug then. Go bug the maitainer (mrness) on irc or open a bug!

 

My theory is that the following statement is misleading: *UberLord wrote:*   

> Any reason why you can't put your script in /etc/ppp/ip-up.local?
> 
> As that gets called every time ppp gets an ip ...  

 

I think the script gets called only when the link comes up, not "every time ppp gets an IP".  For this, I think I would need to use dhcpcd, which can be programmed to call a script for that exact purpose.  The problem is that the base layout does not permit (I think) combinning use of config_eth1( "adsl" ) and config_eth1( "dhcp" ).

So, I guess I'm again asking how I can get dhcpcd functionality on a PPPoE link, or maybe get this functionality straight from the base layout (call a script on ip updates).

----------

## UberLord

Well, if you want, you could do this

```
config_eth0=( "adsl" "dhcp" )

dhcpcd_eth0="-c /path/to/script"

```

You could also use dhclient (in net-misc/dhcp) and the script /etc/dhcp/dhclient-exit-hooks will be sourced and run every time an action event occurs.

But basically, once pppd hands you an IP it does not change - if it has to change then the peer will close the link causing pppd to reconnect and re-run ......

----------

## tecknojunky

 *UberLord wrote:*   

> But basically, once pppd hands you an IP it does not change - if it has to change then the peer will close the link causing pppd to reconnect and re-run ......

 After reading on and on, it does seem to be the correct behavior and, somehow, pppd does not invoke /etc/ppp/ip-up.

I'm emerging the latest ppp ebuild to filter out any potential bugs.

```
[ebuild     U ] net-dialup/ppp-2.4.3-r10 [2.4.2-r15] -activefilter -atm -dhcp -eap-tls -gtk +ipv6 -mppe-mppc +pam -radius 725 kB
```

Any suggestion about use flags?

----------

## UberLord

 *tecknojunky wrote:*   

> Any suggestion about use flags?

 

Only activate what you need. My USE flags for pppd just have ipv6 and pam

----------

## tecknojunky

 *tecknojunky wrote:*   

> I'm emerging the latest ppp ebuild to filter out any potential bugs.

 

OMG!!!  :Shocked:   :Shocked:   :Shocked:  At last!  :Rolling Eyes:  It worked!  :Very Happy: 

I can finally launch scripts to renew the various dns services I make business with!

Many thanks UbberLord.  You rock!

( Spit!  Extra wipe!  Glossy! )  :Wink: 

----------

