[SOLVED] SIOCADDRT error and two gateway for same destination when I use pptp?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It takes some time for the network to be initialized, and until the network is initialized the route command can't work. Normally, the previous default route would be removed, but I think it works because the system will use the first one found in the route table.
What is going on is that the pppd service is authenticating connecting, and authenticating.
To avoid that, pppd has a "defaultroute" option that will set your default route after the connection is established, and avoid having to do it manually. I believe this should be in the configuration file for shayu13.
It takes some time for the network to be initialized, and until the network is initialized the route command can't work. Normally, the previous default route would be removed, but I think it works because the system will use the first one found in the route table.
What is going on is that the pppd service is authenticating connecting, and authenticating.
To avoid that, pppd has a "defaultroute" option that will set your default route after the connection is established, and avoid having to do it manually. I believe this should be in the configuration file for shayu13.
Can you give more suggestion about "defaultroute" . Actually, the configuration is I created by the pptpsetup. Thanks
call name
Read additional options from the file /etc/ppp/peers/name. This
file may contain privileged options, such as noauth, even if
pppd is not being run by root. The name string may not begin
with / or include .. as a pathname component. The format of the
options file is described below.
...
defaultroute
Add a default route to the system routing tables, using the peer
as the gateway, when IPCP negotiation is successfully completed.
This entry is removed when the PPP connection is broken. This
option is privileged if the nodefaultroute option has been spec‐
ified.
Thus I concluded that the defaultroute option needs to be in the /etc/ppp/peers/shayu13 configuration.
It is also quite possible that you have to add a script to /etc/ppp/ip-up.d/... to get it to work at the right time.
The directory might not exist (not that many use CentOS with PPP - I've never needed it) and you would have to create it.
If you haven't tried it yet, I would suggest using the "defaultroute" in the options file in /etc/ppp/options file first. It is also possible it won't try the ip-up.d directory unless it is trying to set the network parameters... (and not having one should give an error message)
The directory might not exist (not that many use CentOS with PPP - I've never needed it) and you would have to create it.
If you haven't tried it yet, I would suggest using the "defaultroute" in the options file in /etc/ppp/options file first. It is also possible it won't try the ip-up.d directory unless it is trying to set the network parameters... (and not having one should give an error message)
Thank you
I add the "defaultroute" in end line of the options file in /etc/ppp/options.pptp. And then in my shayu13 configuration. I add
Code:
file /etc/ppp/options.pptp
. But it doesn't work.
I browse the website and it shows my ip is
Code:
172.16.*.*
The fourth line of the
Quote:
Originally Posted by ytyyutianyun
172.16.*.*
Last edited by ytyyutianyun; 02-20-2015 at 11:12 PM.
If you read the pppd manpage you will find that it reads the file "options".
Code:
OPTIONS FILES
Options can be taken from files as well as the command line. Pppd
reads options from the files /etc/ppp/options, ~/.ppprc and
/etc/ppp/options.ttyname (in that order) before processing the options
on the command line. (In fact, the command-line options are scanned to
find the terminal name before the options.ttyname file is read.) In
forming the name of the options.ttyname file, the initial /dev/ is
removed from the terminal name, and any remaining / characters are
replaced with dots.
An options file is parsed into a series of words, delimited by white‐
space. Whitespace can be included in a word by enclosing the word in
double-quotes ("). A backslash (\) quotes the following character. A
hash (#) starts a comment, which continues until the end of the line.
There is no restriction on using the file or call options within an
options file.
So now put the setup in the routing setup script as per the reference.
Sorry, but I can't understand what the "routing setup script" and "reference" refers to. Would you mind talking more details. I'll appreciate it. Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.