Linux下查看IP地址的命令
2015-07-23 13:43
471 查看
ifconfig
Linux下查看IP地址的命令--ifconfig
ifconfig命令用于查看和更改网络接口的地址和参数
$ifconfig -a
lo0: flags=849 mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863 mtu 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
ether 8:0:20:a7:4d:21
系统会显示网络接口的名称,接口的状态(up or down),
接口的IP地址和掩码等信息
更改网络接口的IP地址:
#ifconfig hme0 down
#ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up
首先,使用down命令参数把网络接口hme0的服务暂时停止,然后再用ifconfig命令给
接口分配新的IP地址和掩码,并启动网络接口服务
也可以通过改变文件/etc/hosts中的IP地址的值并重新启动系统来更改机器的IP地址。
/etc/hosts/:
211.101.149.11 sampdt
定义主机名在/etc/hostname.hme0及IP地址。
更改了网卡/增加了网卡,系统不能自动启动该接口服务,这时需要手动创建网口服务:
#ifconfig hme0 plumb
即可以为接口le0创建网口服务
相应地,用ifconfig带unplumb参数可以停止服务并关闭网络.
netconfig 用来设置IP地址
Linux下查看IP地址的命令--ifconfig
ifconfig命令用于查看和更改网络接口的地址和参数
$ifconfig -a
lo0: flags=849 mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863 mtu 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
ether 8:0:20:a7:4d:21
系统会显示网络接口的名称,接口的状态(up or down),
接口的IP地址和掩码等信息
更改网络接口的IP地址:
#ifconfig hme0 down
#ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up
首先,使用down命令参数把网络接口hme0的服务暂时停止,然后再用ifconfig命令给
接口分配新的IP地址和掩码,并启动网络接口服务
也可以通过改变文件/etc/hosts中的IP地址的值并重新启动系统来更改机器的IP地址。
/etc/hosts/:
211.101.149.11 sampdt
定义主机名在/etc/hostname.hme0及IP地址。
更改了网卡/增加了网卡,系统不能自动启动该接口服务,这时需要手动创建网口服务:
#ifconfig hme0 plumb
即可以为接口le0创建网口服务
相应地,用ifconfig带unplumb参数可以停止服务并关闭网络.
netconfig 用来设置IP地址
相关文章推荐
- Linux下使用U盘
- 在 RHEL/CentOS 上为Web服务器架设 “XR”(Crossroads) 负载均衡器
- linux yum rz 安装
- Linux磁盘管理之df命令详解和使用实例
- Linux大文件已删除,但df查看已使用的空间并未减少解决
- Linux傻瓜式搭建GitLab服务
- Linux下Patch的应用和制作方法
- linux下配置SS5(SOCK5)代理服务
- Linux性能测试 pmap命令
- CentOS下安装hadoop
- [转载] Linux进程关系
- linux的tee命令
- 在linux下使用PPPOE程序拨号连接小区宽带xDSL的方法
- iptables和selinux的问题
- centos php扩展开发流程
- centos7 安装配置openstack-ceilometer (官网openstack-juno版)
- 添加几个关于linux及linux运维的博客地址
- linux ACL权限控制
- linux ACL权限控制
- tinyXml在linux下的使用