# Cfg\_gateway script doesn't configure as dhcp server

**URL:** <https://forum.sierrawireless.com/t/cfg-gateway-script-doesnt-configure-as-dhcp-server/14487>\
**Category:** WP Series\
**Created:** [November 16, 2018, 3:23pm UTC](https://forum.sierrawireless.com/t/cfg-gateway-script-doesnt-configure-as-dhcp-server/14487 "2018-11-16T15:23:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stirulaka](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@stirulaka](https://forum.sierrawireless.com/u/stirulaka)\
**Post date:** [November 16, 2018, 3:23pm UTC](https://forum.sierrawireless.com/t/cfg-gateway-script-doesnt-configure-as-dhcp-server/14487/1 "2018-11-16T15:23:04Z")

</div>

hi,

We are using the wp7608 and we had succesfull ue attach.  
We have configured the gateway between cellular network and with the ethernet interface via HSIC ethernet bridge IOT module.

How ever when we run the cfg\_gateway.sh script

MangOH gateway configuration  
Enter WAN (cellular) interface (default: rmnet\_data0):  
WAN interface rmnet\_data0  
Enter LAN interface (default: eth0):  
LAN interface eth0  
Enter LAN IP (default: 192.168.20.1):  
IP address (192.168.20.1)  
Enter LAN Net Mask (default: 255.255.255.0):  
net mask (255.255.255.0)  
Mounting LAN interface ‘eth0’ IP: ‘192.168.20.1’, net mask: ‘255.255.255.0’  
Check SIM inserted…  
SIM card is inserted and unlocked (LE\_SIM\_READY).

Enter the Host ipaddres that the data packets to be forwarded (default: 192.168.20.20):  
IP address (192.168.20.20)  
Enter the port data packets to be forwarded in Downlink (default: 1234):  
Mounting the relay interface ‘rmnet\_data0’…  
Enabling the radio on ‘rmnet\_data0’…  
Radio power is already set to ON.  
Enter APN (default: b3.mttm):  
Enabling the data connection on ‘rmnet\_data0’ using APN ‘b3.mttm’…  
Setting up profile 1  
Setting access point name … ok  
Setting packet data protocol … ok  
Setting Authentication … ok  
Connecting … ok  
Checking if device is up … ok  
Routing … ok  
Updating /etc/resolv.conf … ok  
Testing connection … Waiting for data connection on ‘rmnet\_data0’…  
Relay interface ‘rmnet\_data0’ IP address is ‘172.27.30.2’  
Cleaning IP tables…  
Enabling IP forwarding…  
net.ipv4.ip\_forward = 1  
Configuring the NAT…  
Configure DHCP server (Y/n): Y  
Enter start IP (default: 192.168.20.10):  
IP address (192.168.20.10)  
Enter end IP (default: 192.168.20.100):  
IP address (192.168.20.100)  
**Reconfiguring the DHCP server…**  
**stopping DNS forwarder and DHCP server: dnsmasq… no /usr/bin/dnsmasq found; none killed**  
**UNABLE TO STOP THE DHCP server**

The script is getting failed in configuring the modem a dhcp server. Hence it is not able to assign the ipaddress to the HOST Automatically. Below is the output of the script

---

<div class="post-metadata">

**Author:** ![cadams](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@cadams](https://forum.sierrawireless.com/u/cadams)\
**Post date:** [August 24, 2020, 9:10pm UTC](https://forum.sierrawireless.com/t/cfg-gateway-script-doesnt-configure-as-dhcp-server/14487/2 "2020-08-24T21:10:41Z")

</div>

I am having the same problem, has anyone solved this issue yet???

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [August 25, 2020, 2:18am UTC](https://forum.sierrawireless.com/t/cfg-gateway-script-doesnt-configure-as-dhcp-server/14487/3 "2020-08-25T02:18:18Z")

</div>

How about comment out the "exit 1 " in the script?

> ```
> echo "Reconfiguring the DHCP server..."
> /etc/init.d/dnsmasq stop
> if ["$?" -ne 0]; then
> echo "UNABLE TO STOP THE DHCP server"
> # exit 1
> fi
> 
> ```
