|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!主机名
检查
- [root@localhost~]#hostnamelocalhost.localdomain[root@localhost~]#
复制代码
暂时修正
- [root@localhost~]#hostnamecentoscn[root@localhost~]#hostnamecentoscn[root@localhost~]#
复制代码
永远失效
- [root@localhost~]#vim/etc/sysconfig/networkNETWORKING=yesHOSTNAME=centoscn
复制代码
host文件
- [root@localhost~]#vim/etc/hosts127.0.0.1localhostlocalhost.localdomainlocalhost4localhost4.localdomain4#建议保存此行10.15.72.194localhostjustinlocalhost6localhost6.localdomain6#必需有三个字段:IP、FQDN、HOSTNAME
复制代码
IP设置装备摆设
暂时设置
- [root@localhost~]#ifconfigeth010.15.72.194netmask255.255.255.0
复制代码
永远失效
- [root@localhost~]#cd/etc/sysconfig/network-scripts/[root@localhostnetwork-scripts]#lsifcfg-eth0ifdown-isdnifup-aliasesifup-plusbinit.ipv6-globalifcfg-loifdown-postifup-bnepifup-postnet.hotplugifdownifdown-pppifup-ethifup-pppnetwork-functionsifdown-bnepifdown-routesifup-ipppifup-routesnetwork-functions-ipv6ifdown-ethifdown-sitifup-ipv6ifup-sitifdown-ipppifdown-tunnelifup-isdnifup-tunnelifdown-ipv6ifupifup-plipifup-wireless[root@localhostnetwork-scripts]#cpifcfg-eth0ifcfg-eth0bak#备份[root@localhostnetwork-scripts]#vimifcfg-eth0DEVICE=eth0#指出装备称号NM_CONTROLLED=yes#networkmamager的参数,及时失效,不须要重启ONBOOT=yes#设置为yes,开机主动启用收集衔接IPADDR=10.15.72.194#IP地址BOOTPROTO=static#设置为none制止DHCP,设置为static启用静态IP地址,设置为dhcp开启DHCP办事NETMASK=255.255.255.0#子网掩码DNS1=8.8.8.8#第一个dns办事器TYPE=Ethernet#收集类型为:EthernetGATEWAY=10.15.72.254#设置网关DNS2=8.8.4.4#第二个dns办事器IPV6INIT=no#制止IPV6USERCTL=no#能否许可非root用户掌握该装备,设置为no,只能用root用户更改HWADDR=00:0C:29:2C:E1:0F#网卡的Mac地址PREFIX=24DEFROUTE=yesIPV4_FAILURE_FATAL=yesNAME="Systemeth0"#界说装备称号
复制代码
DEVICE、ONBOO、TBOOTPROTO、IPADDR、NETMASK、GATEWAY必需设置装备摆设
单网卡设置双IP
- [root@localhostnetwork-scripts]#cpifcfg-eth0ifcfg-eth0:0DEVICE=eth0:0NM_CONTROLLED=yesONBOOT=yesIPADDR=10.15.72.195BOOTPROTO=staticNETMASK=255.255.255.0DNS1=8.8.8.8TYPE=EthernetGATEWAY=10.15.72.254DNS2=8.8.4.4IPV6INIT=noUSERCTL=noHWADDR=00:0C:29:2C:E1:0FPREFIX=24DEFROUTE=yesIPV4_FAILURE_FATAL=yesNAME="Systemeth0:0"
复制代码
Mac地址修正
- [root@localhostnetwork-scripts]#ifconfigeth0|grepHWaddeth0Linkencap:EthernetHWaddr00:0C:29:81:38:08[root@localhostnetwork-scripts]#ifconfigeth0down[root@localhostnetwork-scripts]#ifconfigeth0hwether00:0C:29:28:28:28[root@localhostnetwork-scripts]#ifconfigeth0|grepHWaddreth0Linkencap:EthernetHWaddr00:0C:29:28:28:28[root@localhostnetwork-scripts]#ifconfigeth0up
复制代码
路由
检查
- [root@localhostnetwork-scripts]#routeKernelIProutingtableDestinationGatewayGenmaskFlagsMetricRefUseIface10.15.72.0*255.255.255.0U100eth0default10.15.72.2540.0.0.0UG000eth0[root@localhostnetwork-scripts]#route-nKernelIProutingtableDestinationGatewayGenmaskFlagsMetricRefUseIface10.15.72.00.0.0.0255.255.255.0U100eth00.0.0.010.15.72.2540.0.0.0UG000eth0[root@localhostnetwork-scripts]#
复制代码
静态路由添加、删除
- [root@localhostnetwork-scripts]#routeadd-net10.15.72.194/24gw10.15.72.254[root@localhostnetwork-scripts]#routedel-net10.15.72.194/24
复制代码
默许网关添加、删除
- [root@localhost~]#hostnamecentoscn[root@localhost~]#hostnamecentoscn[root@localhost~]#0
复制代码
收集节点测试
- [root@localhost~]#hostnamecentoscn[root@localhost~]#hostnamecentoscn[root@localhost~]#1
复制代码
收集连通性测试
- [root@localhost~]#hostnamecentoscn[root@localhost~]#hostnamecentoscn[root@localhost~]#2
复制代码
ARP信息
[root@localhostnetwork-scripts]#arp-n#检查以后体系的ARP表
AddressHWtypeHWaddressFlagsMaskIface
10.15.72.254ether08:d0:9f:e2:4d:c3Ceth0
10.15.72.73ether00:25:64:a6:08:afCeth0
[root@localhostnetwork-scripts]#arp-s10.15.72.25408:d0:9f:e2:4d:c3#网关绑定ip和网关的mac
[root@localhostnetwork-scripts]#arp-d10.15.72.73#删除arp记载
本文出自“进程就是为了完成成果”博客,请务必保存此出处http://justinpeng.blog.51cto.com/7662323/1302137
欢迎大家来到仓酷云论坛! |
|