13

I left Ubuntu and came back after a while so I don't remember much. Now I'm trying to get my IP address. All I'm getting from running ifconfig is

eth0      Link encap:Ethernet  HWaddr 3c:97:0e:11:22:0d  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 Memory:f2500000-f2520000 

(BTW, I don't really understand what UP BROADCAST MULTICAST means.)

 $ sudo ifdown eth0 
 ifdown: interface eth0 not configured 

Then

$ sudo ifup eth0
Ignoring unknown interface eth0=eth0

And finally 2:

$ ip addr show eth0
eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN   
group default qlen 1000 link/ether 3c:97:0e:11:22:0d brd ff:ff:ff:ff:ff:ff
bain
  • 10,860
  • 2
  • 42
  • 48
MasterPorky
  • 131
  • 1
  • 1
  • 3
  • possible duplicate of [Command for determining my public IP?](http://askubuntu.com/questions/95910/command-for-determining-my-public-ip) – edwin Jul 15 '14 at 00:01
  • 2
    Close voters this question is not a duplicate of [Command for determining my public IP?](http://askubuntu.com/q/95910/107450). In that question the computer already has a local IP address and is trying to find the IP they have on the internet which may have been changed by the router or ISP. This question is about why they can't get any IP address. – Warren Hill Jul 18 '14 at 16:55
  • 4
    Have you found any solution to this problem? – alex Jun 04 '15 at 15:19
  • 7
    NO-CARRIER means that the network jack detects no signal on the line. This is usually because the network cable is unplugged or broken. In rare cases it can also be hardware failure or a driver bug. Have you checked the cables and rebooted the system? – tudor -Reinstate Monica- Oct 09 '18 at 00:45
  • what is the possible reason for NO-CARRIER in a virtual machine and how to fix it ? – Harshit Pant Oct 23 '20 at 09:56
  • The result is on virtual machine, when Hyper-v is set to external network switch – Vladimir Yanakiev Jan 28 '22 at 23:40

5 Answers5

5

A remote possibility for this issue can be a misconfigured Ethernet Interface.

Use ethtool eth0 command to get the existing configuration.
In some cases, you might find

# ethtool eth0
Settings for eth0:
    ...
    Speed: Unknown!
    Duplex: Unknown! (255)
    ...

If so, set the speed and duplex using:

ethtool -s eth0 speed 100 duplex full

For modern networks, this config should work.
Once the speed and duplex are set, do dhclient eth0 if you still don't get an IP.


Note: The above setup will reset on reboot. So, if the above solution solves your problem, add following lines to /etc/rc.local:

ethtool -s eth0 speed 100 duplex full
dhclient eth0
Jithin Pavithran
  • 1,015
  • 10
  • 17
3

Is this problem on a virtual machine? If so in the Advanced Network settings, on the Hypervisor see if the "cable connected" check box is ticked. It might just be that the VM isn't connected to the network

MetsoNyach
  • 31
  • 1
  • Your answer is priceless! Indeed, this is often the case with VMs. It is also possible that someone mistakes one interface for another (e.g. enp0s3 for enp0s8 on a VBox VM). – Arthur Khazbs Mar 31 '23 at 00:13
0

I have solved this problem by:

  1. Copying ifcfg file which currently run
  2. Putting the correct ip number as you want with its subnet on the new one. For ex: ifcfg-eth0 to ifcfg-eth1.
  3. Restarting the desktop.

It worked correctly for me.

Marc Vanhoomissen
  • 2,198
  • 6
  • 24
  • 36
0

Try :

ifdown eth0
ifup eth0
ip addr show eth0

The meanings of UP, BROADCAST, and MULTICAST

  • UP - device is functioning
  • BROADCAST - device can send traffic to all hosts on the link
  • MULTICAST - device can perform and receive multicast packets

More about mulicast visit Site

Chai T. Rex
  • 5,126
  • 1
  • 24
  • 48
nux
  • 37,371
  • 34
  • 117
  • 131
  • 1
    I tried the commands and none of them worked out so far. sudo ifdown eth0 ifdown: interface eth0 not configured Then sudo ifup eth0 Ignoring unknown interface eth0=eth0 And finally 2: eth0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 link/ether 3c:97:0e:11:22:0d brd ff:ff:ff:ff:ff:ff – MasterPorky Jul 15 '14 at 04:45
0

You might just try setting your IP address to something on your subnet. Assuming you're on a 192.168.1.255 network, try this:

ifconfig address 192.168.1.50 netmask 255.255.255.0 gateway 192.168.1.1

Replace 192.168.1.50 with the IP you want to get, and replace 192.168.1.1 with the IP address of your router/gateway.

I have had a similar problem, and this solved it for me.

Daniel
  • 3,400
  • 2
  • 22
  • 43