Ubuntu-16.04.2-Server配置網路卡IP
root@ubuntu:/etc/network# vi /etc/network/interfaces
root@ubuntu:/etc/network# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens33
iface ens33 inet dhcp #自動獲取IP的設定
auto ens38
iface ens38 inet static
address 192.168.3.166
netmask 255.255.255.0 #固定IP的設定
auto ens39
iface ens39 inet dhcp #自動獲取IP的設定
root@ubuntu:/etc/network# ifconfig -a| grep inet
inet addr:192.168.142.12 Bcast:192.168.142.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d40/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
root@ubuntu:/etc/network# systemctl restart networking.service #重啟網路服務
root@ubuntu:/etc/network# ifconfig -a| grep inet
inet addr:192.168.142.12 Bcast:192.168.142.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d40/64 Scope:Link
inet addr:192.168.3.166 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d4a/64 Scope:Link
inet addr:192.168.1.6 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d54/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
root@ubuntu:/etc/network# ifconfig -a
ens33 Link encap:Ethernet HWaddr 00:0c:29:e9:9d:40
inet addr:192.168.142.12 Bcast:192.168.142.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d40/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6164 errors:0 dropped:0 overruns:0 frame:0
TX packets:549 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:403243 (403.2 KB) TX bytes:72747 (72.7 KB)
ens38 Link encap:Ethernet HWaddr 00:0c:29:e9:9d:4a
inet addr:192.168.3.166 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d4a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:648 (648.0 B)
ens39 Link encap:Ethernet HWaddr 00:0c:29:e9:9d:54
inet addr:192.168.1.6 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee9:9d54/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1678 (1.6 KB) TX bytes:1332 (1.3 KB)
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:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
root@ubuntu:/etc/network#
root@ubuntu:/etc/network# ping 192.168.3.166
PING 192.168.3.166 (192.168.3.166) 56(84) bytes of data.
64 bytes from 192.168.3.166: icmp_seq=1 ttl=64 time=0.014 ms
^C
--- 192.168.3.166 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.014/0.014/0.014/0.000 ms
root@ubuntu:/etc/network# ping 192.168.1.6
PING 192.168.1.6 (192.168.1.6) 56(84) bytes of data.
64 bytes from 192.168.1.6: icmp_seq=1 ttl=64 time=0.034 ms
^C
--- 192.168.1.6 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.034/0.034/0.034/0.000 ms
root@ubuntu:/etc/network#來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29734436/viewspace-2140557/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux 雙網路卡雙IP配置Linux
- Oracle Linux 7.1 增加網路卡及IP配置OracleLinux
- linux下一個網路卡配置多個IPLinux
- AIX中為單網路卡配置多IP地址(轉)AI
- 獲取網路卡 IP
- Linux單網路卡繫結多IP與多網路卡共用單IPLinux
- VMwareNAT網路卡配置
- 雙網路卡單IP(轉貼)
- ubuntu下網路卡配置多獨立ip的方法,非常簡單Ubuntu
- 【Linux伺服器雙IP配置】如何實現不同IP的雙網路卡同時上網?Linux伺服器
- Linux 網路卡配置Linux
- 配置雙網路卡BOND
- 雙網路卡BOND配置
- ECS彈性網路卡+彈性公網IP配置最佳實踐之策略路由路由
- LINUX as 5自帶的配置網路卡的IP害慘了我Linux
- 雲主機新增網路卡配置多網路卡策略路由路由
- kali網路卡配置檔案
- vmware克隆機網路卡配置
- (轉)Ubuntu網路卡基本配置Ubuntu
- 雙網路卡bonding配置
- 多網路卡路由出口配置路由
- 【Linux】Linux網路配置基礎3 編輯配置檔案設定網路卡子介面ipLinux
- Qt下如何獲得本地網路卡IPQT
- Solaris下網路卡繫結多個IP
- rac更改public and private的網路卡和ip
- Windows 一個網路卡配多個IPWindows
- win10如何修改虛擬網路卡ip_win10虛擬網路卡怎麼設定ip地址Win10
- RAC中如何更改對外網路卡和內部網際網路卡的IP及VIP
- 虛擬機器網路卡配置虛擬機
- Linux 7 配置網路卡(nmcli)Linux
- OpenHarmony雙網路卡配置例項
- redhat network網路卡配置示例Redhat
- CentOS 6.5 修改網路卡配置資訊CentOS
- Solaris 10 網路卡相關配置
- 如何在centos上配置802.1Q VLAN標記,linux單網路卡多vlan多網段Ip配置案例CentOSLinux
- 網路卡配置及對應名稱
- 樹莓派配置無線網路卡樹莓派
- suse linux配置網路卡bondingLinux