If your network does not include a DHCP server or it is disabled (typically, these are built into most modern ADSL/cable modems or routers), you may need to configure your network settings manually.
Before you start, you will need to determine the network settings for your network.
You will need to find out the following information from your router's settings or another computer connected to the network:
192.168.1.X
if netmask
is 255.255.255.0
), but it should not already be used by another computer. However, avoid x.x.x.255
as the last address since this is reserved as a broadcast address.255.255.255.0
, which allows up to 254 addresses). This is also sometimes referred to as the netmask.8.8.8.8
and 8.8.4.4
. These are also called nameservers in some systems.For Windows, you can obtain this information by connecting to the Internet and running the following command:
ipconfig /all
Locate the active connection (usually called Local Area Connection 1 or similar if you are using a wired connection, or if you are using Wi-Fi, it is called wireless network connection) and find the information required, as follows:
For Linux and Mac OS X, you can obtain the required information with the following command (note that it is ifconfig
rather than ipconfig
):
ifconfig
The DNS servers are called nameservers and are usually listed in the resolv.conf
file. You can use the less
command as follows to view its contents (press Q to quit when you have finished viewing it):
less /etc/resolv.conf
To set the network interface settings, edit /etc/network/interfaces
using the following code:
sudo nano /etc/network/interfaces
Now, perform the following steps:
address
number we want to allocate to it, the netmask
address of the network, and the gateway
address, as follows:iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.254
/etc/resolv.conf
using the following code:sudo nano /etc/resolv.conf
nameserver 8.8.8.8 nameserver 8.8.4.4
You can configure the network settings by editing cmdline.txt
in the BOOT
partition and adding settings to the startup command line with ip
.
The ip option takes the following form:
ip=client-ip:nfsserver-ip:gw-ip:netmask:hostname:device:autoconf
client-ip
option is the IP address you want to allocate to the Raspberry Pigw-ip
option will set the gateway server address if you need to set it manuallynetmask
option will directly set the netmask of the networkhostname
option will allow you to change the default raspberrypi
hostnamedevice
option allows you to specify a default network device if more than one network device is presentautoconf
option allows the automatic configuration to be switched on or off18.191.216.163