login|Register
Forum > Raspbian
Post|
看22203|回9|Favorite
mp9546 看全部
2019-1-7 18:11:37
Where to find the samples.
I had tried two cases

Case 1:
Sudo  nano /etc/dhcpcd.conf

interface eth0   ######====for raspberry pi3
static ip_address=192.168.8.119
static routers=192.168.8.1
static domain_name_servers=192.168.8.1

Case 2:
Sudo  nano   /etc/network/interfaces
# start ###
auto lo
iface lo inet loopback
# Static IP address
auto eth0      # ou auto enp0s7 (see  ifconfig)
iface eth0 inet static
        address 192.168.8.119
        netmask 255.255.255.0
        gateway 192.168.8.1
# end ###
Werner 看全部
2019-1-7 20:42:21
mp9546 看全部
2019-1-7 23:26:38
Thanks.
I try again, it is unable to set successfully.
This is similar to the case 2, posted Previously.
Werner 看全部
2019-1-8 16:43:03
If you do not plan to use dhcp at all you can remove the package using APT (still assuming Raspbian base is Debian).
Did you check ifconfig to make sure the network interfaces device tag is actually eth0 and not something weird like enp0s7?

Did you try to reboot the board after setting the new configuration?
mp9546 看全部
2019-1-9 01:02:36
Thanks.
I've got it.
The process is
~~~~~~~~~~
sudo nano /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0     
iface eth0 inet static
address 192.168.8.119
netmask 255.255.255.0
gateway 192.168.8.254
~~~~~~~~~~~~~~~~~~~~
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

(remove all content)

~~~~~~result~~~~~~~~~~~~
root@orangepi:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 7a:de:15:88:e4:fd  
          inet addr:192.168.8.119  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fe80::78de:15ff:fe88:e4fd/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:88 errors:0 dropped:0 overruns:0 frame:0
          TX packets:201 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9602 (9.3 KiB)  TX bytes:10410 (10.1 KiB)
          Interrupt:114
12NextPage

OrangePi En

Powered by Discuz! X3.4

homepage|Simple edition|Touch edition|PC