Tag Info

Hot answers tagged

92

Quoting Thomas Pircher's website (cc-by-sa): ifconfig vs ip The command /bin/ip has been around for some time now. But people continue using the older command /sbin/ifconfig. Let's be clear: ifconfig will not quickly go away, but its newer version, ip, is more powerful and will eventually replace it. The man page of ip may look intimidating at first, but ...


20

The official statement regarding the plans to obsolete net-tools was made on the debian-devel mailing list in early 2009 by one of the net-tools maintainers. True to their statement, net-tools has been hardly maintained at all since that time. Luk Claes and me, as the current maintainers of net-tools, we've been thinking about it's future. Net-tools ...


17

You can get all necessary info via proc # cat /sys/class/net/eth0/statistics/rx_bytes # cat /sys/class/net/eth0/statistics/rx_packets # cat /sys/class/net/eth0/statistics/tx_packets # cat /sys/class/net/eth0/statistics/tx_bytes Also you can use iptables and parse output. For received packets # iptables -L INPUT -n -v for transmitted packets # ...


16

ifconfig is deprecated for many years now, time to switch, especially in a case like yours.


16

Another option is to use the /proc filesystem. The /proc/net/dev file contains statistics about the configured network interfaces. Each line is dedicated to one network interface and it contains statistics for receive and transmit. The statistics include metrics such total number of received/transmittted bytes, packets, drops, errors and so on. cat ...


16

The ip command which is part of the the iproute2 package is the new tool. The link subcommand is for managing the devices/interfaces. If you can get the stats of an interface using ip -s link root:~# ip -s link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 RX: bytes ...


15

Yes, ifconfig is deprecated in favor of iproute2 (the ip command) on Linux. However, iproute2 is Linux specific, when some other Unixes use ifconfig, so it may help to know/remember how it works if you're ever going to use another Unix... To learn the "new way", I suggest you to look at those 3 links : iproute2: Life after ifconfig (the basics, from ...


14

On the man page of ifconfig for Fedora, it says this: IFCONFIG(8) Linux System Administrator's Manual IFCONFIG(8) NAME ifconfig - configure a network interface SYNOPSIS ifconfig [-v] [-a] [-s] [interface] ifconfig [-v] interface [aftype] options | address ... NOTE This program is obsolete! For replacement ...


12

You need to configure those IPs on that interface. ip addr add 72.9.239.195/29 dev eth1 ip addr add 72.9.239.196/29 dev eth1 ip addr add 72.9.239.197/29 dev eth1 ip addr add 72.9.239.198/29 dev eth1 You can also use the ifcfg-eth1:n files in /etc/sysconfig/network-scripts to make this configuration last across reboots. See Red Hat's documentation for ...


10

Generally speaking, "promiscuous mode" means that a network interface card will pass all frames received up to the operating system for processing, versus the traditional mode of operation wherein only frames destined for the NIC's MAC address or a broadcast address will be passed up to the OS. Generally, promiscuous mode is used to "sniff" all traffic on ...


9

There might be a utility, but I don't know what it is. You can just create a file at /etc/sysconfig/network-scripts/ifcfg-eth0 with contents similar to: DEVICE=eth0 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.0.199 NETMASK=255.255.255.0 GATEWAY=192.168.0.1


8

This is a distro-specific issue. net-tools has been deprecated by just about every major distro (or distro upstream), though, so in effect the entire community is switching from ifconfig to ip -- but the change is slow, as some distros have an extremely long shelf-life (RHEL,for example). You are less likely to find a deprecation announcement than an item ...


7

Something fairly simple that you can modify to suit your needs: ip addr show dev eth0 | fgrep -q 'inet 192.168.1.1' if [ $? -eq 0 ]; then echo 'IP found' else echo 'IP not found' fi EDIT: forgot the fgrep :)


7

You do not need root access to use ifconfig to change IP addresses, only CAP_NET_ADMIN. Let's create a copy of ifconfig with CAP_NET_ADMIN enabled to see this: cp /sbin/ifconfig . sudo setcap cap_net_admin=eip ./ifconfig ./ifconfig eth0 1.2.3.4 # succeeds # Wouldn't want to leave this copy of ifconfig around, # It's a security hole! rm ifconfig


6

This question has been answered on SF already. In short, the only way on a Linux box (at present) is to reload the network driver module, which may or may not be possible with your kernel configuration.


6

Check out the facter package. It is used mostly by the puppet config management program to grab metadata from installed machines, but it can be run in a standalone fashion for similar purposes. Its output does include information about network interfaces found on the machine, and its formatting will be consistent across platforms. Example output: ...


6

Carrier errors occur when there is a problem with the modulation of your signal. This could indicate either a duplex mismatch, or a problem with the physical cable/connector. Restarting autonegotiation and checking the ethernet connector are some things you could try to fix the problem. Look here for some instructions on how to restart autonegotiation.


6

ip has been the replacement for ifconfig for a while, probably at some point ifconfig will update, however I wouldn't wait for it and learn to work with ip as well. Its supported on all linux distri's


5

eth0 and eth0:0 are the same interface. Use eth0:1 for an alias. Could it be that DEVICE=eth0 should actually be DEVICE=eth0:0?


5

I would say it is the 4GB wraparound as you are guessing. I ran into this with fairly recent 32 bit linux kernels. You can grab the source code for your kernel and see if it is the same in include/linux/netdevice.h and check the data type of net_device_stats->rx_bytes. If you are using a 32 bit system and the time is an unsigned long you will get only ...


5

Flush the ip: root@foo:~# ifconfig dummy0 192.168.55.1 netmask 255.255.255.0 root@foo:~# ifconfig dummy0 dummy0 Link encap:Ethernet HWaddr 5b:72:32:4f:92:c8 inet addr:192.168.55.1 Bcast:192.168.55.255 Mask:255.255.255.0 UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 ...


5

RX errors mean that your NIC is receiving malformed frames from the transmitting switchport. Frame errors mean CRC failures on receipt of a frame. The root cause of this could be a bad cable, or a bad interface on either the machine or the switch. Try replacing the cable, then moving to another port on the switch.


5

From that output.. you only have 1 IP on the interface. You have been assigned that block but you have to alias the other IPs to that interface. You can see if you have them aliased via ip address show quick and old way is using ifconfig to add aliases ifconfig eth1:1 72.9.239.195 netmask 255.255.255.0 Same command for the other IPs.


5

Use multicast. Each client would need to join the group, but this is a very low overhead task. You'd have the additional benefit of being able to have clients on other machines be able to efficiently receive the message. Failing this, look into one of the various message bus packages (i.e. mqueue, rabbitmq, etc) that will allow for reliable delivery of ...


5

You do not "add" a broadcast address. You direct traffic to the broadcast address of a network. The broadcast address is an entirely virtual concept, and should not be "added" or otherwise assigned to any host in normal practice. The exception to the above rule is specifying the broadcast address (using ifconfig broadcast) which is done in cases where ...


5

The order in which the addresses are down isn't really relevant. The problem is that Linux usually uses the first configured address as default source address for IPv4 but the last configured address for IPv6. That that address shows up on top is coincidence. If you want to manually define the default source address you can do so in the routing table. This ...


4

The first thing to try is to make sure you have link. You can check this using either # ethtool eth0 or # mii-tool eth0 Look for a line about Link Detected. If it says no, then you have a problem with your network card, network cable or switch. I wrote a guide to troubleshooting network problems that you might find useful.


4

Ask the people who adminster the dhcp server which assigns addresses to your server, it's the only way to know for sure. You can relatively safely assume that your ipaddress always will be within ip-address binary-and netmask, there's however no guarantee of this behaviour, and chances are that the dhcp-servers address pool will be a subset of ipaddress ...


4

In FreeBSD an ifconfig that removes direct connectivity to a subnet also zaps routes containing that subnet (IIRC updating netmasks is reduced to a remove-and-replace). This is a "feature" so as not to confuse your routing configuration by trying to talk to a host it can't reach anymore, though it causes its share of confusion when users encounter ...


4

What OS and VM are you using? If you aren't adding a new IP and only updating the I'd just edit one of the two files depending if you are using a Debian flavored OS or a Redhat based OS With Debian based (e.g., Ubuntu, Debian, Xandros, Mint) the change the settings in /etc/network/interfaces followed by: service networking restart RedHat based (e.g., ...



Only top voted, non community-wiki answers of a minimum length are eligible