Debian wvdial parse result to auto set the IP address

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I'm trying to get wvdial to work automatically with a Telit LE910 WCDMA modem. My script will start up the connection as needed, then disconnect when not needed to prevent wasted data. One of the telit commands to set up the modem is to send AT+CGPADDR=3 and the result from this returns the IP address my carrier has provided.
in my wvdial.conf, I have this as one of the lines



init5 = AT+CGPADDR=3 


The response to that init string is



+CGPADDR: 3,"100.121.106.244","254.128.0.0.0.0.0.0.0.0.1.128.162.96.1"
OK


The IP address changes every time I connect.
With all the appropriate configurations in my wvdial.conf, wvdial completes successfully and connects.
But my connection isn't fully complete until I manually issue two more commands in script or via command-line, and I'm not finding an easy way to pass that ip address back to the script to run unattended.
To complete the connection, I have to type



ifconfig usb0 100.121.106.244 netmask 255.255.255.0 -arp up
route add default usb0


Is there some way in the wvdial.conf to have it do something with the init5 variable that could pass the result back to the script so that the connection completes automatically?



The rest of my wvdial is



[Dialer Defaults]
Init1 = ATZ
Init2 = AT+CGMR
Init3 = AT#ncm=1,3
Init4 = AT+cgact=1,3
Init5 = AT+cgpaddr=3
Init6 = at+cgdcont?
Init7 = AT+CGDATA="M-RAW_IP",3
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Modem = /dev/ttyACM3
Baud = 460800









share|improve this question









New contributor




Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite
    1












    I'm trying to get wvdial to work automatically with a Telit LE910 WCDMA modem. My script will start up the connection as needed, then disconnect when not needed to prevent wasted data. One of the telit commands to set up the modem is to send AT+CGPADDR=3 and the result from this returns the IP address my carrier has provided.
    in my wvdial.conf, I have this as one of the lines



    init5 = AT+CGPADDR=3 


    The response to that init string is



    +CGPADDR: 3,"100.121.106.244","254.128.0.0.0.0.0.0.0.0.1.128.162.96.1"
    OK


    The IP address changes every time I connect.
    With all the appropriate configurations in my wvdial.conf, wvdial completes successfully and connects.
    But my connection isn't fully complete until I manually issue two more commands in script or via command-line, and I'm not finding an easy way to pass that ip address back to the script to run unattended.
    To complete the connection, I have to type



    ifconfig usb0 100.121.106.244 netmask 255.255.255.0 -arp up
    route add default usb0


    Is there some way in the wvdial.conf to have it do something with the init5 variable that could pass the result back to the script so that the connection completes automatically?



    The rest of my wvdial is



    [Dialer Defaults]
    Init1 = ATZ
    Init2 = AT+CGMR
    Init3 = AT#ncm=1,3
    Init4 = AT+cgact=1,3
    Init5 = AT+cgpaddr=3
    Init6 = at+cgdcont?
    Init7 = AT+CGDATA="M-RAW_IP",3
    Modem Type = USB Modem
    ISDN = 0
    New PPPD = yes
    Modem = /dev/ttyACM3
    Baud = 460800









    share|improve this question









    New contributor




    Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I'm trying to get wvdial to work automatically with a Telit LE910 WCDMA modem. My script will start up the connection as needed, then disconnect when not needed to prevent wasted data. One of the telit commands to set up the modem is to send AT+CGPADDR=3 and the result from this returns the IP address my carrier has provided.
      in my wvdial.conf, I have this as one of the lines



      init5 = AT+CGPADDR=3 


      The response to that init string is



      +CGPADDR: 3,"100.121.106.244","254.128.0.0.0.0.0.0.0.0.1.128.162.96.1"
      OK


      The IP address changes every time I connect.
      With all the appropriate configurations in my wvdial.conf, wvdial completes successfully and connects.
      But my connection isn't fully complete until I manually issue two more commands in script or via command-line, and I'm not finding an easy way to pass that ip address back to the script to run unattended.
      To complete the connection, I have to type



      ifconfig usb0 100.121.106.244 netmask 255.255.255.0 -arp up
      route add default usb0


      Is there some way in the wvdial.conf to have it do something with the init5 variable that could pass the result back to the script so that the connection completes automatically?



      The rest of my wvdial is



      [Dialer Defaults]
      Init1 = ATZ
      Init2 = AT+CGMR
      Init3 = AT#ncm=1,3
      Init4 = AT+cgact=1,3
      Init5 = AT+cgpaddr=3
      Init6 = at+cgdcont?
      Init7 = AT+CGDATA="M-RAW_IP",3
      Modem Type = USB Modem
      ISDN = 0
      New PPPD = yes
      Modem = /dev/ttyACM3
      Baud = 460800









      share|improve this question









      New contributor




      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm trying to get wvdial to work automatically with a Telit LE910 WCDMA modem. My script will start up the connection as needed, then disconnect when not needed to prevent wasted data. One of the telit commands to set up the modem is to send AT+CGPADDR=3 and the result from this returns the IP address my carrier has provided.
      in my wvdial.conf, I have this as one of the lines



      init5 = AT+CGPADDR=3 


      The response to that init string is



      +CGPADDR: 3,"100.121.106.244","254.128.0.0.0.0.0.0.0.0.1.128.162.96.1"
      OK


      The IP address changes every time I connect.
      With all the appropriate configurations in my wvdial.conf, wvdial completes successfully and connects.
      But my connection isn't fully complete until I manually issue two more commands in script or via command-line, and I'm not finding an easy way to pass that ip address back to the script to run unattended.
      To complete the connection, I have to type



      ifconfig usb0 100.121.106.244 netmask 255.255.255.0 -arp up
      route add default usb0


      Is there some way in the wvdial.conf to have it do something with the init5 variable that could pass the result back to the script so that the connection completes automatically?



      The rest of my wvdial is



      [Dialer Defaults]
      Init1 = ATZ
      Init2 = AT+CGMR
      Init3 = AT#ncm=1,3
      Init4 = AT+cgact=1,3
      Init5 = AT+cgpaddr=3
      Init6 = at+cgdcont?
      Init7 = AT+CGDATA="M-RAW_IP",3
      Modem Type = USB Modem
      ISDN = 0
      New PPPD = yes
      Modem = /dev/ttyACM3
      Baud = 460800






      linux shell-script debian wvdial






      share|improve this question









      New contributor




      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 8 hours ago





















      New contributor




      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 8 hours ago









      Daniel Near

      62




      62




      New contributor




      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Daniel Near is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Daniel Near is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474319%2fdebian-wvdial-parse-result-to-auto-set-the-ip-address%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Daniel Near is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Daniel Near is a new contributor. Be nice, and check out our Code of Conduct.












          Daniel Near is a new contributor. Be nice, and check out our Code of Conduct.











          Daniel Near is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474319%2fdebian-wvdial-parse-result-to-auto-set-the-ip-address%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?