ifconfigeth1
A. linux只有一个网卡 用ifconfig显示网卡eth1 在network-sricpt中只有ifcfg-eth0
一般来说,如果只有一个网卡的话是不会出现两个eth的,默认情况下只有eth0,而你这个eth1跟eth0不是一个硬件,没有eth1这个硬件的话,ifup eth1肯定是没反应的。
B. linux怎么查eth1网卡是否启动,求口令
1、ifconfig看下,能看到eth1代表启动着,顺便看下ip地址是否配置正确。
2、ifconfig功能说明:显示或设置网络设备
语法:ifconfig [网络设备][down up -allmulti -arp -promisc][add<地址>][del<地址>][<硬件地址>] [media<网络媒介类型>][mem_start<内存地址>][metric<数目>][mtu<字节>][netmask<子网掩码>][tunnel<地址>][-broadcast<地址>] [-pointopoint<地址>]
补充说明:ifconfig可设置网络设备的状态,或是显示目前的设置。
参数:
[网络设备] 网络设备的名称。
down 关闭指定的网络设备。
up 启动指定的网络设备。
-arp 打开或关闭指定接口上使用的ARP协议。前面加上一个负号用于关闭该选项。
-allmuti 关闭或启动指定接口的无区别模式。前面加上一个负号用于关闭该选项。
-promisc 关闭或启动指定网络设备的promiscuous模式。前面加上一个负号用于关闭该选项。
add<地址> 设置网络设备IPv6的IP地址。
del<地址> 删除网络设备IPv6的IP地址。
media<网络媒介类型> 设置网络设备的媒介类型。
mem_start<内存地址> 设置网络设备在主内存所占用的起始地址。
metric<数目> 指定在计算数据包的转送次数时,所要加上的数目。
mtu<字节> 设置网络设备的MTU。
netmask<子网掩码> 设置网络设备的子网掩码。
tunnel<地址> 建立IPv4与IPv6之间的隧道通信地址。
-broadcast<地址> 将要送往指定地址的数据包当成广播数据包来处理。
-pointopoint<地址> 与指定地址的网络设备建立直接连线,此模式具有保密功能。
C. Linux中ifconfig命令作用有哪些
linux中ifconfig命令属于网络配置命令
ifconfig命令被用于配置和显示Linux内核中网络接口的网络参数。用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在。要想将上述的配置信息永远的存的电脑里,那就要修改网卡的配置文件了。
语法
ifconfig(参数)
参数
add<地址>:设置网络设备IPv6的ip地址;
del<地址>:删除网络设备IPv6的IP地址;
down:关闭指定的网络设备;
<hw<网络设备类型><硬件地址>:设置网络设备的类型与硬件地址;
io_addr<I/O地址>:设置网络设备的I/O地址;
irq<IRQ地址>:设置网络设备的IRQ;
media<网络媒介类型>:设置网络设备的媒介类型;
mem_start<内存地址>:设置网络设备在主内存所占用的起始地址;
metric<数目>:指定在计算数据包的转送次数时,所要加上的数目;
mtu<字节>:设置网络设备的MTU;
netmask<子网掩码>:设置网络设备的子网掩码;
tunnel<地址>:建立IPv4与IPv6之间的隧道通信地址;
up:启动指定的网络设备;
-broadcast<地址>:将要送往指定地址的数据包当成广播数据包来处理;
-pointopoint<地址>:与指定地址的网络设备建立直接连线,此模式具有保密功能;
-promisc:关闭或启动指定网络设备的promiscuous模式;
IP地址:指定网络设备的IP地址;
网络设备:指定网络设备的名称。
使用功能示例
启动关闭指定网卡:
ifconfig eth0 up
ifconfig eth0 down
ifconfig eth0 up为启动网卡eth0,ifconfig eth0 down为关闭网卡eth0。ssh登陆linux服务器操作要小心,关闭了就不能开启了,除非你有多网卡。
为网卡配置和删除IPv6地址:
ifconfig eth0 add 33ffe:3240:800:1005::2/64 #为网卡eth0配置IPv6地址
ifconfig eth0 del 33ffe:3240:800:1005::2/64 #为网卡eth0删除IPv6地址
用ifconfig修改MAC地址:
ifconfig eth0 hw ether 00:AA:BB:CC:dd:EE
配置IP地址:
[root@localhost ~]# ifconfig eth0 192.168.2.10
[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0
[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255
启用和关闭arp协议:
ifconfig eth0 arp #开启网卡eth0 的arp协议
ifconfig eth0 -arp #关闭网卡eth0 的arp协议
设置最大传输单元:
ifconfig eth0 mtu 1500 #设置能通过的最大数据包大小为 1500 bytes
D. linux怎么查eth1网卡是否启动,求口令
1、ethtool命令
ethtool eth1
2、mii-tool命令
mii-tool em1
em1: negotiated 1000baseT-FD flow-control, link ok
mii-tool em3
em3: no link
3、ip addr
4、ifconfig eth1也可以看出来,启动后有RUNNING字样
E. linux下,用ifconfig后,看到有eth0,还有eth0:1,请问eth0:1是什么意思
eth0:1是eth0的分ip存储文件
分ip存储文件格式为ifcfg-eth0:X
X为任意正整数(包括0)
具体作用是实现单网卡多ip
类似与windows的多ip
F. linux系统中ifconfig命令 帮忙分析哈 看不懂
Linux操作系统Ifconfig命令详细解析无论是Linux 自动安装还是我们手工安装,Linux 都会向你询问有关网络的问题并配置相关的软件。这个用于配置网卡的基本命令就是ifconfig。 在执行ifconfig 命令后,系统将在内核表中设置必要的参数,这样Linux 就知道如何与网络上的网卡通信。ifconfig 命令有以下两种格式: ※ifconfig [interface] ※ifconfig interface [aftype] option | address … ifconfig 的第一种格式(或使用不带任何参数的ifconfig 命令)可以用来查看当前系统的网络配置情况。 在刚刚安装完系统之后,实际上是在没有网卡或者网络连接的情况下使用Linux,但通过ifconfig 可以使用回绕方式工作,使计算机认为自己工作在网络上。 现在我们运行一下ifconfig 命令,不带参数的ifconfig 命令可以显示当前启动的网络接口,其输出结果为:
[root@machine1 /sbin]#ifconfig eth0 Link encap:Ethernet Hwaddr 52:54:AB:DD:6F:61 inet addr:210.34.6.89 Bcast:210.34.6.127 Mask:255.255.255.128 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:46299 errors:0 dropped:0 overruns:0 frame:189 TX packets:3057 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 Interrupt:5 Base address:0xece0 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3924 Metric:1 RX packets:44 errors:0 dropped:0 overruns:0 frame:0 TX packets:44 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
其中以eth0 为首的部分是本机的以太网卡配置参数,这里显示了网卡在下的设备名/dev/eth0 和硬件的MAC 地址52:54:AB:DD:6F:61,MAC 地址是生产厂家定的,每个网卡拥有的唯一地址。 不过我们可以手工改动网卡的MAC 地址,只要我们在/etc/rc.d/init.d/中的network 中加入: ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx 然后重启,此时再用ifconfig 命令查看一下,我们就会发现网卡的MAC 地址已经变成xx:xx:xx:xx:xx:xx了。
后继 常用网卡ip设置方法:
直接通过setup 进行设置。
配置多个网卡 ifconfig -a 查看网络设备 eth0 / eth1 / lo (回路)。
ifconfig eth1 //设备1
ifconfig eth1 192.168.1.10 netmask 255.255.255.0 //设置网卡子网及ip
man ifconfig
ifconfig --help(T002)
G. watch ifconfig中的 eth1 lo是什么意思呢
eth1,网卡名
lo 网络回环设备,一个虚拟的网络接口,127.0.0.1
H. 电脑输入ifconfig -a后出现mmy0、eth0、eth1、lo这几项是什么都
eth0 eth1
eth表示本机以太网卡,0表示网卡1--一般是有线网卡,1表示网卡2---一般是无线网卡
lo表示localhost
mmy是一个虚拟网络设备,来帮助本地网络配置IP的。0就表示1号虚拟网络设备
mmy的概念比较生僻。涉及到一些现在不太常用的概念PPP,SLIP Address等
I. ifconfig配置ip
一、ifconfig与IP
1、ifconfig添加或修改原IP
ifconfig eth0 192.168.10.199 或
ifconfig eth0 192.168.10.199 netmask 255.255.255.0 up
ifconfig eth0:1 192.168.10.198 netmask 255.255.255.0 up
注:以上两台效果是一样的,上面一种写法是下面一种写法的减缩版。如果eth0上之前已经配置这IP,该配置会将原来的IP清掉,换成上面配置的IP,但在远程ssh时最好不要使用该方法,因为网络环境不同。一旦更改不生效,就要跑到机房再进行配置。
2、禁用启用网卡
ifconfig eth0 down
ifconfig eth0 up
该用法,是不是和ifup eth0、ifdown eth0:1很像?
注:当一块网卡上配置多个IP时,如eth0、eth0:1时,如果禁掉eth0:1时,eth0上的网卡配置依然生效。但禁掉直接物理网卡口时(即eth0)时,其后面配置的IP (eth0:1等)都将被删除掉。另外,ifconfig 还可以用于设置mtu和设置网卡的混杂模式:
ifconfig eth0 mtu 1472
利用netstat -i查看
将eth0设置成混杂模式
ifconfig eth0 promisc
取消混杂
ifconfig eth0 -promisc
3、修改网卡mac地址:
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
ifconfig查看的信息里,经常被我们忽视的第三行非常有用,如在没有mii-tool工具时,可以通过其查看网卡连接状态。
UP(代表网卡开启状态)RUNNING(代表网卡的网线被接上)MULTICAST(支持组播)MTU:1500(最大传输单元):1500字节
二、ip命令与IP
ip是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具,例如ifconfig、route等,使用权限为超级用户。
1、ip命令添加一个IP地址:
[root@localhost ~]# ip addr add 192.168.10.198/24 dev eth0:1
[root@localhost ~]# ip addr add 192.168.10.199/24 dev eth0
[root@localhost ~]# ip -f inet addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
inet 192.168.10.26/24 brd 192.168.10.255 scope global eth0
inet 192.168.10.198/24 scope global secondary eth0
inet 192.168.10.199/24 scope global secondary eth0
[root@localhost ~]# ip addr add 192.168.10.200/24 dev eth0:3
[root@localhost ~]# ip -f inet addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
inet 192.168.10.26/24 brd 192.168.10.255 scope global eth0
inet 192.168.10.198/24 scope global secondary eth0
inet 192.168.10.199/24 scope global secondary eth0
inet 192.168.10.200/24 scope global secondary eth0
当然,上面的增加地址的写法,我们也可以使用以下两种方式增加,不过由于没有上面的写法容易记,我平时很少会用下面的方式增加:
ip addr add local 192.168.4.1/28 brd + label eth0:1 dev eth0
ip addr add 192.168.4.2/24 brd + dev eth1 label eth1:1
由上面的操作命令不难看出,随便我们怎么去添加IP,后面的设备名无论是eth0、eth0:1、eth0:100也好,其都不会将原网卡上绑定的地址给清掉。其通过ip addr show 显示的出的结果都是secondary eth0 。
注:ip addr命令增加的IP ,不能通过ifconfig查看到,也不能通过ifconfig eth0:1 down 或ifdown eth0:1 这样的方式停掉。
2、ip命令删除一个IP
[root@localhost ~]# ip addr del 192.168.10.200
Not enough information: "dev" argument is required.
[root@localhost ~]# ip addr del 192.168.10.200 dev eth0
Warning: Executing wildcard deletion to stay compatible with old scripts.
Explicitly specify the prefix length (192.168.10.200/32) to avoid this warning.
This special behaviour is likely to disappear in further releases,
fix your scripts!
[root@localhost ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 40:61:86:98:95:05 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.26/24 brd 192.168.10.255 scope global eth0
inet 192.168.10.198/24 scope global secondary eth0
inet 192.168.10.199/24 scope global secondary eth0
inet6 fe80::4261:86ff:fe98:9505/64 scope link
valid_lft forever preferred_lft forever
3: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
[root@localhost ~]# ip addr del 192.168.10.199/24 dev eth0
在不加掩码删除时,其会提示警告,但还是可以将其地址删掉。ip命令的用法比较多,就不一一列举了。
三、路由配置
增加路由
route add -net 192.168.6.0/24 gw 192.168.101.254
route add default gw 192.168.101.254
查看路由
ip route list
route –n
netstat –r
四、总结
以上的ifconfig和ip命令配置的信息,重启都会清除,想要永久生效,还是配置相关的配置文件。不过掌握命令配置方法很重要,在LVS+keepalive等架构上,浮动IP的变动,很多都是通过ip命令来完成的。
J. 今天在ubuntu种打命令:ifconfig,只有一个lo。以前都还有一个eth1的,不知道电脑怎么了,怎样在出现eth1
跟你你描述的情况看的话,应该你的物理网卡没有启用,如果你想看到你的网卡的话可以使用:ifconfig -all 查看
你可以用ifconfig eth1 <ipaddress> netmask <netmask> up 命令来启用你的网卡
谢谢。