Linux网络配置
ifconfig命令(立即生效 重启失效)
ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up 配ip和掩码立即激活
ifdown eth0 关闭eth0 ifup打开
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx修改mac地址
ifconfig eth0:0 192.168.1.1 netmask 255.255.255.0设置别名
修改配置文档(重启生效)
vi /etc/sysconfig/network 主机名
setup命令
启动和关闭防火墙
即时生效:
#service iptables start
#service iptables stop
修改主机名三种方法:1、hostname 更改,2、hosts 更改,3、/etc/sysconfig/network
netstat -rn 查看网关 0开头的是默认网关
/etc/resolv.conf 查看DNS