Ubuntu和树莓派配置静态IP

Ubuntu配置静态ip

第一步:先获取网卡名称,输入ifconfig,我们的网卡名称

第二步:修改网卡配置文件sudo  vim /etc/network/interfaces

auto lo
iface lo inet loopback

auto enp4s0
iface enp4s0 inet static
address 192.168.0.109
netmask 255.255.255.0
gateway 192.168.0.1

第三步:重启网络服务 $ sudo /etc/init.d/networking restart

 

树莓派3b配置静态ip

第一步:sudo nano /etc/dhcpcd.conf

第二步:添加ip信息

interface wlan0

static ip_address=192.168.0.100/24

static routers=192.168.0.1

static domain_name_servers=114.114.114.114

第三步:保存,reboot重启生效

你可能感兴趣的:(linux)