# Change APN using +cgdcont command

**URL:** <https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413>\
**Category:** MC/EM Series\
**Created:** [May 15, 2019, 8:38pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413 "2019-05-15T20:38:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 15, 2019, 8:38pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/1 "2019-05-15T20:38:53Z")

</div>

Hi I have an interesting problem…

I am using a EM7450 modem. I am using the +cgdcont command to change the APN for profile 1. Since I am using a AT&T card, the APN is m2m.com.attz. I noticed a few times when I changed the APN to something like mickeymouse, the connection remains active even though this is obviously the wrong APN for the SIM card.  
Shouldn’t the connection go down when I change the APN to something bogus?

---

<div class="post-metadata">

**Author:** ![Oedenburger](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/oedenburger/32/4028_2.png) [@Oedenburger](https://forum.sierrawireless.com/u/Oedenburger)\
**Post date:** [May 15, 2019, 9:38pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/2 "2019-05-15T21:38:33Z")

</div>

Hello,

at!custom -

“SINGLEAPNSWITCH” Indicate device behavior  
when changing APN name, username, or password.  
:  
• 0 = Do nothing  
• 1 = Device detaches and re-attaches after changing APN information  
• 2 = Power-cycle the UE

thanks,  
James

---

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 15, 2019, 10:39pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/3 "2019-05-15T22:39:33Z")

</div>

It is set to 1. Should I see the ttyUSB\* devices disappear and reappear after a while?

---

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 16, 2019, 2:08am UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/4 "2019-05-16T02:08:49Z")

</div>

It is set to 1 and when I changed the APN, I do not see the module disconnect from the USB bus. Did you mean it detaches and reattaches from the cell network?

What was so strange to me is that the +cgdcont command with the bogus APN was sent and acknowledged by the module, but the cell connection kept going as if nothing happened. I was expecting the network to be brought down by the bogus APN.

---

<div class="post-metadata">

**Author:** ![Oedenburger](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/oedenburger/32/4028_2.png) [@Oedenburger](https://forum.sierrawireless.com/u/Oedenburger)\
**Post date:** [May 16, 2019, 4:02pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/5 "2019-05-16T16:02:56Z")

</div>

> [@dchou4u](#):
>
> Did you mean it detaches and reattaches from the cell network?

Yes , it won’t disconnect from the USB bus.  
option 2 will reset the modem

---

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 16, 2019, 4:50pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/6 "2019-05-16T16:50:25Z")

</div>

So if the APN I entered is bogus, when it reattaches to the network again, the PDP connection should drop right?

---

<div class="post-metadata">

**Author:** ![Oedenburger](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/oedenburger/32/4028_2.png) [@Oedenburger](https://forum.sierrawireless.com/u/Oedenburger)\
**Post date:** [May 16, 2019, 4:51pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/7 "2019-05-16T16:51:17Z")

</div>

yes. you need to reset the modem after programming !custom

---

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 16, 2019, 5:04pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/8 "2019-05-16T17:04:37Z")

</div>

Thanks again for your reply.

Actually I do not want to program !custom. I will just leave the default settings at 1.

What I like to make sure is that when I program the APN with either a valid or bogus setting using +cgdcont, the expected PDP connection behavior will result.

---

<div class="post-metadata">

**Author:** ![Oedenburger](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/oedenburger/32/4028_2.png) [@Oedenburger](https://forum.sierrawireless.com/u/Oedenburger)\
**Post date:** [May 16, 2019, 7:43pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/9 "2019-05-16T19:43:46Z")

</div>

sorry I didn’t get the second part of your comment.

> [@dchou4u](#):
>
> the expected PDP connection behavior will result.

---

<div class="post-metadata">

**Author:** ![dchou4u](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@dchou4u](https://forum.sierrawireless.com/u/dchou4u)\
**Post date:** [May 16, 2019, 8:01pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/10 "2019-05-16T20:01:22Z")

</div>

Thanks for your reply.

So if I use the +cgdcont command to program a bogus APN into a EM7455 module that has an active PDP connection, should it cause the PDP connection to be disrupted?

---

<div class="post-metadata">

**Author:** ![Oedenburger](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/oedenburger/32/4028_2.png) [@Oedenburger](https://forum.sierrawireless.com/u/Oedenburger)\
**Post date:** [May 16, 2019, 11:29pm UTC](https://forum.sierrawireless.com/t/change-apn-using-cgdcont-command/16413/11 "2019-05-16T23:29:22Z")

</div>

yes it will disconnect .  
here is an example captured on my callbox:  
default is the valid APN  
bogus APN is not programmed in the callbox:

at+cgcontrdp  
+CGCONTRDP: 1,5,default,192.168.2.2,8.8.8.8,

OK  
at!custom?  
!CUSTOM:  
GPSENABLE 0x01  
GPSLPM 0x01  
IPV6ENABLE 0x01  
UIM2ENABLE 0x01  
SIMLPM 0x01  
USBSERIALENABLE 0x01  
SINGLEAPNSWITCH 0x01

OK  
at+cgdcont?  
+CGDCONT: 1,“IP”,“default”,“0.0.0.0”,0,0,0,0

OK

at!gstatus?  
!GSTATUS:  
Current Time: 37 Temperature: 28  
Reset Counter: 1 Mode: ONLINE  
System mode: LTE PS state: Attached  
LTE band: B4 LTE bw: 20 MHz  
LTE Rx chan: 2150 LTE Tx chan: 20150  
LTE CA state: NOT ASSIGNED  
EMM state: Registered Normal Service  
RRC state: RRC Idle  
IMS reg state: No Srv

PCC RxM RSSI: -36 RSRP (dBm): -63  
PCC RxD RSSI: -57 RSRP (dBm): -83  
Tx Power: – TAC: 0001 (1)  
RSRQ (dB): -6.0 Cell ID: 01A2D101 (27447553)  
SINR (dB): 28.6

OK  
at+cgcontrdp  
+CGCONTRDP: 1,5,default,192.168.2.2,8.8.8.8,

OK  
at+cgdcont=1,“ip”,“bogus”  
OK  
at+cgcontrdp  
OK  
at!gstatus?  
!GSTATUS:  
Current Time: 79 Temperature: 28  
Reset Counter: 1 Mode: ONLINE  
System mode: LTE PS state: Not attached  
LTE band: B4 LTE bw: 20 MHz  
LTE Rx chan: 2150 LTE Tx chan: 20150  
LTE CA state: NOT ASSIGNED  
EMM state: Deregistered Attaching  
RRC state: RRC Idle  
IMS reg state: No Srv

PCC RxM RSSI: -36 RSRP (dBm): -63  
PCC RxD RSSI: -57 RSRP (dBm): -83  
Tx Power: – TAC: 0001 (1)  
RSRQ (dB): -6.0 Cell ID: 01A2D101 (27447553)  
SINR (dB): 29.0

OK

at+cgcontrdp  
OK  
at+creg?  
+CREG: 0,2

OK  
a/  
+CREG: 0,2

OK
