您的位置:首页 > 运维架构

NanoPi NEO core/ Ubuntu16.04单网卡配置3个IP地址(2个静态,1个动态)

2018-06-20 12:32 1116 查看

配置

root@NanoPi-NEO-Core:/etc/network# cat interfaces
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
address  172.31.188.249
netmask  255.255.0.0
#gateway 172.17.1.1

auto eth0:1
iface eth0:1 inet static
address 10.31.188.249
netmask 255.0.0.0

auto eth0:2
iface eth0:2 inet dhcp

root@NanoPi-NEO-Core:/etc/network#


ifconfig查看配置结果:

root@NanoPi-NEO-Core:/etc/network#
root@NanoPi-NEO-Core:/etc/network# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:81:52:a1:bc:f9
inet addr:172.31.188.249  Bcast:172.31.255.255  Mask:255.255.0.0
inet6 addr: fe80::81:52ff:fea1:bcf9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:6484 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:470066 (470.0 KB)  TX bytes:38537 (38.5 KB)
Interrupt:41

eth0:1    Link encap:Ethernet  HWaddr 02:81:52:a1:bc:f9
inet addr:10.31.188.249  Bcast:10.255.255.255  Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
Interrupt:41

eth0:2    Link encap:Ethernet  HWaddr 02:81:52:a1:bc:f9
inet addr:10.0.0.47  Bcast:10.255.255.255  Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
Interrupt:41

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:84 errors:0 dropped:0 overruns:0 frame:0
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6256 (6.2 KB)  TX bytes:6256 (6.2 KB)

root@NanoPi-NEO-Core:/etc/network#


可以PING通,配置正确:

C:\Windows\system32>ping 10.31.188.249

正在 Ping 10.31.188.249 具有 32 字节的数据:
来自 10.31.188.249 的回复: 字节=32 时间<1ms TTL=64
来自 10.31.188.249 的回复: 字节=32 时间<1ms TTL=64
来自 10.31.188.249 的回复: 字节=32 时间<1ms TTL=64
来自 10.31.188.249 的回复: 字节=32 时间<1ms TTL=64

10.31.188.249 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms

C:\Windows\system32>ping 10.0.0.47

正在 Ping 10.0.0.47 具有 32 字节的数据:
来自 10.0.0.47 的回复: 字节=32 时间<1ms TTL=64
来自 10.0.0.47 的回复: 字节=32 时间<1ms TTL=64
来自 10.0.0.47 的回复: 字节=32 时间<1ms TTL=64

10.0.0.47 的 Ping 统计信息:
数据包: 已发送 = 3,已接收 = 3,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
Control-C
^C
C:\Windows\system32>ping 172.31.188.249

正在 Ping 172.31.188.249 具有 32 字节的数据:
来自 172.31.188.249 的回复: 字节=32 时间=1ms TTL=64
来自 172.31.188.249 的回复: 字节=32 时间<1ms TTL=64
来自 172.31.188.249 的回复: 字节=32 时间<1ms TTL=64
来自 172.31.188.249 的回复: 字节=32 时间<1ms TTL=64

172.31.188.249 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 1ms,平均 = 0ms

C:\Windows\system32>


路由器DHCP分配:

客户端列表
序号 主机名 MAC地址 IP地址 剩余租期
1 HUAWEI_Mate_8 1C-67-58-95-D5-2D 10.0.0.13 46:33:48
2 HUAWEI_Mate_9-5 84-9F-B5-A2-EE-A7 10.0.0.35 23:55:58
3 thinkpad C0-18-85-6B-51-16 10.0.0.36 47:26:09
4 Honor_V8 B0-89-00-29-A0-51 10.0.0.14 46:29:30
5 android-90af1f8 54-DC-1D-49-6B-94 10.0.0.18 47:49:44
6 DESKTOP-KF4D49S C0-18-85-6B-AA-FD 10.0.0.17 44:23:37
7 20171009-1129 20-7C-8F-07-16-3F 10.0.0.16 20:31:22
8 vivo_X7 88-6A-B1-C5-E5-A9 10.0.0.19 23:15:04
9 NanoPi-NEO-Core 02-81-52-A1-BC-F9 10.0.0.47 47:30:55
10 NanoPi-NEO-Core 02-01-DD-48-E2-5C 10.0.0.46 46:06:25
11 android-d457129 00-9A-CD-2B-92-8C 10.0.0.31 28:20:18
12 DESKTOP-V8J70AD B4-6B-FC-22-AF-D8 10.0.0.37 47:45:56
13 android-2679621 BC-3A-EA-C1-27-E5 10.0.0.44 46:18:43

来自 <http://10.0.0.1/userRpm/DhcpServer_ClientList.htm?slt_interface=0>

版本信息

root@NanoPi-NEO-Core:/etc/network# uname -a
Linux NanoPi-NEO-Core 4.14.0 #23 SMP Thu May 10 16:11:19 CST 2018 armv7l armv7l armv7l GNU/Linux
root@NanoPi-NEO-Core:/etc/network#
root@NanoPi-NEO-Core:/etc/network# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial
root@NanoPi-NEO-Core:/etc/network#
root@NanoPi-NEO-Core:/etc/network#
root@NanoPi-NEO-Core:/etc/network# cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

root@NanoPi-NEO-Core:/etc/network# cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 96.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 1
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 96.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 2
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 96.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 3
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 96.00
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: sun8i
Revision	: 0000
Serial		: 02c0008152a1bcf9
root@NanoPi-NEO-Core:/etc/network#
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  V8 Android Linux Ubuntu