# Set static IP

If you need to use a static IP for S2GW then you have to edit /etc/dhcpcd.conf file.

1. To edit the file, start Midnight Commander\
   \&#xNAN;*sudo mc*
2. Go to /*etc/dhcpcd.conf*.

![](https://623241058-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3O2JmRv8Cq2LTrIfpgxe%2Fuploads%2Fgit-blob-770e08ef57e4f6e036f4496aceef68991a5be352%2Fimage33.png?alt=media)

3. Double click “4 Edit” or press F4 to open the file for edition.

![](https://623241058-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3O2JmRv8Cq2LTrIfpgxe%2Fuploads%2Fgit-blob-f08235d91c4010bd58d28feff7672c1c53b12a0d%2Fimage34.png?alt=media)

4. Go to the end of the file.
5. Assuming you want to set Ethernet cable interface to:\
   \
   \- IP 192.168.1.225\
   \- mask 255.255.255.0\
   \- gateway 192.168.1.1.\
   \- DNS 192.168.1.1\
   \
   add\
   \
   \&#xNAN;*`interface eth0`*\
   *`static ip_address=192.168.1.225/24`*\
   *`static routers=192.168.1.1`*\
   *`static domain_name_servers=192.168.1.1`*\
   \
   at the end of the file.\
   \
   For WLAN, add:\
   \
   \&#xNAN;*`interface wlan0`*\
   *`static ip_address=192.168.1.225/24`*\
   *`static routers=192.168.1.1`*\
   *`static domain_name_servers=192.168.1.1`*\
   \
   at the end of the file.
6. Double click “2 Save” or press F2 to save it.
7. Enter “sudo reboot” to restart the system. This will end the terminal connection.

![](https://623241058-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3O2JmRv8Cq2LTrIfpgxe%2Fuploads%2Fgit-blob-9f9b637917cfd261f8e350473a77fb431de23b8b%2Fimage35.png?alt=media)

8. To check the configuration, connect again to the new IP and enter “*ifconfig*”.
