配置网络
1.相关文件
/etc/sysconfig/network-scripts/ifctg-echo ----配置网址
/etc/sysconfig/network ----配置网关
/etc/host.conf ----解释主机IP
/etc/hosts ----配置主机名称
/etc/resolv.conf ----配置DNS
/etc/services ----端口、协议
2.命令方式
ifconfig eth0 192.168.0.3 netmask 255.255.255.0 up
3.修改文件后,重启网络
service network restart
4.配置多个IP
ifconfig echo:0 192.168.0.5 netmask 255.255.0.0 up
ifconfig echo:1 192.168.0.6 netmask 255.255.0.0 up
ifconfig echo:2 192.168.0.7 netmask 255.255.0.0 up
5.删除ip
ifconfig echo:2 down
6.网络工具
ifconfig
ifup
ifdown
hostname
7.查看route
route -n
route add -net netaddr netmask gw ipaddr dev
route add default gw ipaddr
route del -net netaddr netmask gw ipaddr dev
8.检测工具
ping
traceroute 查看路由
curl --head www.163.com 查看网站情况
netstat 查看端口
7532

被折叠的 条评论
为什么被折叠?



