ubuntu 配置静态ip

本文介绍了在Ubuntu 14.04系统中配置静态IP的步骤,包括编辑`/etc/network/interfaces`文件,设置IP地址、子网掩码、网关和DNS。此外,还提供了重启网络服务的命令,并提到了在Ubuntu 16.04中网卡名的变化以及使用NAT模式作为替代方案。
摘要由CSDN通过智能技术生成

系统:ubuntu14.04

命令:sudo vim /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#The primay network interface
auto eth0
iface eth0 inet static
address 192.168.1.88
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 202.96.128.68 8.8.8.8

解析:

    auto lo

    iface lo inet loopback

回环测试,实现ping通本机

    auto eth0

    iface eth0 inet static

打开eth0网卡并配置为静态

    address 192.168.1.88

静态ip地址,不要跟局域网中的其他设备ip相同,否则都不能上网

    netmask 255.255.255.0

广播地址,配置所处网段

    gateway 192.168.1.1

网关,这个和广播地址可以在windows下搜索网络连接,找到后右键状态,详细信息里面找到

    dns-nameservers 202.96.128.68 8.8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值