User Manual Orange Pi Zero 3

  Features   |  Use   |    Linux     |  Linux SDK   |  Android   |  Android SRC   |

RU          EN  

Chapt 3. Instructions for use of Debian/Ubuntu Server and Xfce desktop system
Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122  


3.7.4. How to set static IP address

Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.


3.7.4.1 Use the nmtui command to set a static IP address

  • 1) First run the nmtui command

    orangepi@orangepi:~$ sudo nmtui

  • 2) Then select Edit a connection and press Enter



    Img 3.57

  • 3) Then select the network interface that needs to set a static IP address, for example, to set the static IP address of the Ethernet interface, select Wiredconnection1.


    Img 3.58

  • 4) Then select Edit with the Tab key and press the Enter key


    Img 3.59

  • 5) Then use the Tab key to move the cursor to the 'Automatic' position shown in the figure below to configure IPv4


    Img 3.60

  • 6) Then press Enter, select Manual through the up and down arrow keys, and press Enter to confirm


    Img 3.61

  • 7) The display after selection is shown in the figure below


    Img 3.62

  • 8) Then move the cursor to 'Show' via the Tab key


    Img 3.63

  • 9) Then press Enter, the following setting interface will pop up after entering


    Img 3.64

  • 10) Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address in the position shown in the figure below (there are many other setting options in it, please explore by yourself), please set according to your specific needs. The values set in the image below are just an example


    Img 3.65

  • 11) After setting, move the cursor to 'OK' in the lower right corner, and press Enter to confirm


    Img 3.66

  • 12) Then click 'Back' to return to the previous selection interface


    Img 3.67

  • 13) Then select Activateaconnection, then move the cursor to 'OK', and finally click Enter


    Img 3.68

  • 14) Then select the network interface that needs to be set, such as Wired connection1, then move the cursor to 'Deactivate', and press the Enter key to disable Wired


    Img 3.69

  • 15) Then please do not move the cursor, and then press the Enter key to re-enable Wired connection1, so that the static IP address set earlier will take effect


    Img 3.70

  • 16) Then you can exit nmtui through the 'Back' and Quit buttons


    Img 3.71


    Img 3.72

  • 17) Then through ip aseth0, you can see that the IP address of the network port has changed to the static IP address set earlier

    Note that in the following commands, Debian12 needs to change eth0 to end0.

    orangepi@orangepi:~$ ip a s eth0
     3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.177/24 brd 192.168.1.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever
    inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic
    noprefixroute

    valid_lft 259149sec preferred_lft 172749sec inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute valid_lft forever preferred_lft forever

  • 18) Then you can test the connectivity of the network to check whether the IP address is configured OK, and the ping command can be interrupted through the shortcut key

    Note that in the following commands, Debian12 needs to change eth0 to end0.


    3.7.4.2 Use the nmcli command to set a static IP address

  • 1) If you want to set the static IP address of the network port, please insert the network cable into the development board first. If you need to set the static IP address of WIFI, please connect the WIFI first, and then start to set the static IP address

  • 2) Then you can view the name of the network device through the nmcliconshow command, as shown below

    a. orangepi is the name of the WIFI network interface (the name is not necessarily the same)

    b. Wired connection 1 is the name of the Ethernet interface

    orangepi@orangepi:~$ nmcli con show
    NAME UUID TYPE DEVICE
    orangepi cfc4f922-ae48-46f1-84e1-2f19e9ec5e2a wifi wlan0
    Wired connection 1 9db058b7-7701-37b8-9411-efc2ae8bfa30 ethernet eth0

  • 3) Then enter the following command, where

    a. "Wired connection 1" means to set the static IP address of the Ethernet port. If you need to set the static IP address of the WIFI, please modify it to the corresponding name of the WIFI network interface (you can get it through the nmcli conshow command)

    b. ipv4.addresses is followed by the static IP address to be set, which can be modified to the value you want to set

    c. ipv4.gateway represents the address of the gateway

    orangepi@orangepi:~$ sudo nmcli con mod "Wired connection 1" \ ipv4.addresses "192.168.1.110" \
    ipv4.gateway "192.168.1.1" \
    ipv4.dns "8.8.8.8" \
    ipv4.method "manual"

  • 4) Then restart the linux system

    orangepi@orangepi:~$ sudo reboot

  • 5) Then re-enter the linux system and use the ipaddr show eth0 command to see that the IP address has been set to the desired value

    orangepi@orangepi:~$ ip addr show eth0
     3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.110/32 brd 192.168.1. 110 scope global noprefixroute eth0 valid_lft forever preferred_lft forever
    inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic
    noprefixroute
    valid_lft 259183sec preferred_lft 172783sec
    inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute valid_lft forever preferred_lft forever
    

     <         > 


  • Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122