Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[workaround]net.eth0 cuts net.ppp0 from internet
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
ifle-52
n00b
n00b


Joined: 10 Jan 2011
Posts: 4

PostPosted: Mon Jan 10, 2011 7:51 pm    Post subject: [workaround]net.eth0 cuts net.ppp0 from internet Reply with quote

Hi all,

My ppp connection with wvdial is cut from internet, when my net.eth0 leases / acknowledges an ip address. Only way to get my wvdial connection to work is to disable net.eth0 while I want to use the internet.

How do I make the ppp connection used as the default internet access while it's open?


Last edited by ifle-52 on Wed Jan 12, 2011 7:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Tue Jan 11, 2011 12:30 am    Post subject: Reply with quote

It's not really cut off, it's just that your DHCP client takes the hint from the DHCP server about the default route.
Compare routing tables ('ip r' or 'route -n') before and after your problems.

As of how to solve this, dhcpcd includes an option '--nogateway' but you'll want to specify that one conditionally (depending on whether ppp0 is up). Not sure if conf.d/net can handle such a thing.
Back to top
View user's profile Send private message
ifle-52
n00b
n00b


Joined: 10 Jan 2011
Posts: 4

PostPosted: Tue Jan 11, 2011 5:11 pm    Post subject: Reply with quote

boerKrelis wrote:
It's not really cut off, it's just that your DHCP client takes the hint from the DHCP server about the default route.
Compare routing tables ('ip r' or 'route -n') before and after your problems.

As of how to solve this, dhcpcd includes an option '--nogateway' but you'll want to specify that one conditionally (depending on whether ppp0 is up). Not sure if conf.d/net can handle such a thing.


Thanks, So I would need a script that:

change dhcpcd to --nogateway
starts wvdial
and when exiting wvdial
starts dhcpcd normally

I know how to make a script to do that, but is there a way to change dhchp to nogateway, without losing the ip address it has already gotten? I had to stop the whole dhcpcd and start it again with --nogateway, but it leases a new ip address every time. And of course change it back to gateway without losing it's ip after exiting wvdial.
Back to top
View user's profile Send private message
ifle-52
n00b
n00b


Joined: 10 Jan 2011
Posts: 4

PostPosted: Wed Jan 12, 2011 7:52 pm    Post subject: Reply with quote

I noticed that the problem was with the nameserver and
I came up with a crude workaround that works nice:


/lib/dhcpcd/dhcpcd/hooks/20-resolv.conf
Code:

}
#last lines from the file
if ls /var/run | grep 'ppp0' > dev/null; then
  #do nothing because the ppp connection is up
  else
  #ppp connection is down so
      if $if_up; then #this is eth0
      add_resolv_conf
      elif $if_down; then #this is eth0
      remove_resolv_conf
      fi
fi
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