ubuntu 网络设置 from dhcp to static 博客分类: 操作系统 ubuntunetwork
程序员文章站
2024-03-04 15:10:59
...
os:ubuntu 12.04
configuration files:/etc/network/interfaces
content:
# ,,,,,,,,,,,,,,,,,,
#....................
#....................
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.18
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8
# 加载预设的防火墙策略
pre-up iptables-restore < /etc/iptables.up.rules
生效:sudo /etc/init.d/networking restart