百里登风

导航

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

统计

ubuntu 16.04 静态ip的配置

复制代码
nssa-sensor1@nssa-sensor1:~$ vim /etc/network/interfaces


以下是编辑文件的内容
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
address 192.168.1.101
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameserver 119.29.29.29
~       



完事就保存退出,重启                      


nssa-sensor1@nssa-sensor1:~$ ifconfig
eno1      Link encap:Ethernet  HWaddr 44:37:e6:d0:6b:52  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4637:e6ff:fed0:6b52/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4359 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5500 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3042035 (3.0 MB)  TX bytes:824885 (824.8 KB)
          Interrupt:20 Memory:f7200000-f7220000

enp3s0f0  Link encap:Ethernet  HWaddr 2c:53:4a:02:d8:90  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16

enp3s0f1  Link encap:Ethernet  HWaddr 2c:53:4a:02:d8:91  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:184 errors:0 dropped:0 overruns:0 frame:0
          TX packets:184 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13788 (13.7 KB)  TX bytes:13788 (13.7 KB)

nssa-sensor1@nssa-sensor1:~$


网关的话在这里查看

nssa-sensor1@nssa-sensor1:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eno1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
nssa-sensor1@nssa-sensor1:~$


复制代码

 

posted on   百里登峰  阅读(391)  评论(0编辑  收藏  举报

努力加载评论中...
点击右上角即可分享
微信分享提示