ifconfig eth0; #查看eth0接口网络设置
ifconfig -a #查看所有网络接口的信息route | grep default 显示主机的默认网关。DEVICE=eth0 #设置网络接口名称
ONBOOT=yes #设置网络接口在系统启动时激活。
BOOTPROTO=static #配置为静态地址
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1 #网络接口的默认网关
DNS1=8.8.8.8
DNS2=4.4.4.4DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp auto eth0
iface eth0 inet static
address 192.168.1.75
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8
dns-nameservers 4.4.4.4auto eth0
iface eth0 inet dhcpcat /etc/resolv.conf
这篇文章不错: Linux(Ubuntu) iptables使用小记
喜欢 (2)or分享 (0)