I'm having trouble getting my Ubuntu 10.04 machine (Sony Vaio VGN-SR490) to connect to the Internet by way of an Ethernet cable connected directly to my router.
I'm able to connect to the Internet using this same cable using a Windows machine, so there's something wrong with the way Linux is configured.
How do I got about figuring out what the problem is and solving it?
Here are my network settings on Linux:
Here are my network settings on Windows (Vista):
I censored my IP address from these results. If that information is needed, just let me know.
Here is the content of
/etc/network/interfaces
:After adding
auto eth0
, here are the latest results:Here are the results of running a modprobe:
I removed Linux from my computer and installed Windows XP, at the request of some of the people commenting on this question. I installed an ran a program to find out details about the network card. Here is that information:
It looks like the network adapters list is empty. I will now install both Windows XP and Ubuntu Linux dual-boot. I'm still not able to access the internet, even through Windows. I'm wonder if this could be a hardware problem with the computer or a problem with the router itself. Other computers can connect to this same router, and work fine. (That's how I'm posting this after all!)
Hennes59.7k77 gold badges9494 silver badges144144 bronze badges
Kathryn HallettKathryn Hallett
7 Answers
First of all, your ethernet isn't being managed by Ubuntu. Try
ifconfig -a
instead of just ifconfig
, so you can see all your networking devices, managed or not. If you do see ethX in the ifconfig -a
list, the solution should be straightforward, and you seemed to have gotten half of it. The following needs to go into your /etc/network/interfaces
file:The first line 'activates' management of the interface and the second line sets it to DHCP and IP.
However, if you don't even see any ethX interfaces when you do
ifconfig -a
, it's a driver issue (Ubuntu isn't even seeing the interface). To solve this, either check from Windows' device manager for the PCI Vendor ID and Device ID of your ethernet card, which you can cross-reference here and see if you can find a driver for that (Vendor ID is the manufacturer, Device ID is the acutal model of the ethernet card). An alternative in-linux way to do this is via lspci
. In Windows 7, getting the Vendor/Device IDs is through the Device Manager -- open up the Network Interfaces node, double click on your network card, click on 'detail', and select 'Hardware IDs' from the drop-down list. The Vendor ID are the 4 hexadecimal digits after the
VEN_
prefix, and the device id is the 4 hex digits after the &DEV_
immediately following the vendor.atanamiratanamir
I dont see anything in the comments suggesting that you look into udev and its rules which should install eth0. On my system, in /etc/udev/rules.d/75-network-devices.rules, I have the following;
Also, make sure you have udevd running. This is what creates ethx on a Slackware based system.
mbairmbair
I had a similar problem. By running
ifconfig -a
, I determined that the only network devices on my computer were p4p1
and lo
. There was no eth0
.So I edited
/etc/network/interfaces
, replacing all instances of eth0
with p4p1
. The file's contents are now:After rebooting, the networking was working fine.
If it matters, I was using Ubuntu 12.04.5 Server edition.
David GraysonDavid Grayson27011 gold badge66 silver badges1313 bronze badges
You may also want to try ls /etc/init.d | grep eth and see if there is anything in the init as an artifact that ETH0 was ever there. The above is what use in Gentoo, I think Ubuntu uses a different mechanism but its worth a shot.
Back in Ubuntu 6.06 I had an issue like this, I ended clearing the CMOS on the MB and somehow it solved my problem. That's a stab in the dark though.
C0D3M0NK3YC0D3M0NK3Y
You only need to rename the
slhck70-persistent-net.rules
file in /etc/udev/rules.d
.167k4848 gold badges466466 silver badges482482 bronze badges
Vu Le Ngoc AnhVu Le Ngoc Anh
I solved the problem for myself after months of hair pulling:
- Go to update manager at the top click on view.
- Select the kernel version at the bottom of the list (which for me was4.4.0-78 but for some it will be some version above 4.8).
- Click on install.
I unplugged the WiFi dongle, and lo and behold I now have wired internet. With the wireless dongle out of course there is now no
wlan0
.Captain GlenCaptain Glen
In general if you don't see your network interface, it's either that it has a different name (like eth1 instead of eth0) or it doesn't have its driver loaded. When I had similar problem, I was able to fix them by either adjusting /etc/interfaces or by modprobe .
Gary DaleGary Dale
Not the answer you're looking for? Browse other questions tagged linuxubuntunetworkingwired-networking or ask your own question.
After learning how to mount devices using Linux, you may want to see a list of the mounted devices. This guide will show you how to list the devices, drives, PCI devices, and USB devices on your computer. For finding out which drives are available, you will briefly be shown how to show the mounted devices and how to show all the drives.
Use the Mount Command
The most simple syntax you can use is as follows:
The output from the above command is fairly verbose and will be something like this:
There is so much information that it really isn't that easy to read.
Hard drives generally start with /dev/sda or /dev/sdb so you can use the grep command to reduce the output as follows:
The results this time will show something like this:
This doesn't list out your drives but it does list out your mounted partitions. It doesn't list partitions that aren't yet mounted.
The device /dev/sda usually stands for hard drive 1 and if you have a second hard drive, then it will be mounted to /dev/sdb. If you have an SSD, then this will likely be mapped to /dev/sda and the hard drive mapped to /dev/sdb.
As you can see in the screenshot. this computer has a single /dev/sda drive with 2 partitions mounted. The /dev/sda4 partition has an ext4 filesystem and it is where Ubuntu is installed. The /dev/sda1 is the EFI partition used to boot the system in the first place.
This computer is set up to dual boot with Windows 10. In order to see the Windows partitions, we will need to mount them.
Use lsblk to List Block Devices
Mount is OK for listing mounted devices, but it doesn't show every device you have and the output is very verbose, making it difficult to read.
The best way to list out the drives in Linux is to use lsblk as follows:
The information is displayed in a tree format with the following information:
- Name
- Major Minor version number
- Is it removable
- Size
- Is it read-only
- Is it a disk or a partition
- Where is the partition mounted
The display looks something like this:
- sda - 8.0 - 0 - 931 GB - 0 - disk
- sda1 - 8.1 - 0 - 500M - 0 - part - /boot/efi
- sda2 - 8.2 - 0 - 128M - 0 - part
- sda3 - 8.3 - 0 - 370.6 G - 0 - part
- sda4 - 8.4 - 0 - 554.4 G - 0 - part /
- sda5 - 8.5 - 0 - 5.9G - 0 - part - [SWAP]
- sr0 - 11:0 - 1 - 1024M - 0 - rom
The information is much easier to read. You can see that we have one drive called sda, which has 931 gigabytes. SDA is split into 5 partitions — 2 or which are mounted and a third which is assigned to swap.
There is also a drive called sr0 which is the built-in DVD drive.
How to List PCI Devices
One thing that it is really worth learning about Linux is that if you want to list anything, then there is usually a command which starts with the letters 'ls'.
You have already seen that 'lsblk' lists out block devices and can be used to show the way disks are laid out.
You should also know that the ls command is used to get a directory listing.
Later on, you will use the lsusb command to list out the USB drives on the computer.
You can also list out devices by using the lsdev command but you will need to make sure procinfo is installed in order to use that command.
To list out the PCI devices use the lspci command as follows:
The output from the above command is again very verbose, meaning you probably get more information than you bargained for.
Here is a short snapshot from our listing:
The listing lists everything from VGA controllers to USB, sound, Bluetooth, wireless, and ethernet controllers.
Ironically, the standard lspci listing is considered basic and if you want more detailed information about each device, you can run the following command:
The information for each device looks something like this:
The output from the lspci -v command is actually more readable and you can clearly see that we have a Qualcomm Atheros wireless card.
You can get even more verbose output by using the following command:
If that isn't enough, try the following:
And if that isn't enough.. No, we're only kidding. It stops there.
The most useful aspect of lspci, other than listing out devices, is the kernel driver that is used for that device. If the device isn't working, it is possibly worth researching whether there is a better driver available for the device.
![Can_raw_err_filter Can_raw_err_filter](/uploads/1/2/3/7/123715764/887704467.png)
List the USB Devices Attached to the Computer
To list out the USB devices available for your computer use the following command:
The output will be something like this:
If you insert a USB device into the computer, such as an external hard drive, and then run the lsusb command, you will see the device appear on the list.
Summary
To summarize then, the best way to list anything out in Linux is to remember the following ls commands:
- ls - list files in the file system
- lsblk - list the block devices (i.e. drives)
- lspci - list the pci devices
- lsusb - list the USB devices
- lsdev - list all the devices
I'm currently trying to use a SocketCAN-enabled device (Kvaser USBcan Light 2xHS) on a Dell Edge Gateway 3002 running Ubuntu Core 16.
This CAN interface has been tested on Ubuntu Desktop successfully.
The CAN kernel modules are not loaded by default on Ubuntu Core 16, so my first step was to load them:
Connecting the CAN interface at this point should result in the creation of two new can interfaces (
can0
and can1
by default). The problem is that those interfaces are nowhere to be found:The output of
dmesg
shows that there was some kind of security issue. I'm not familiar with AppArmor so I'm not exactly sure if this has any relevance:Is there anyone with previous experience with SocketCAN devices on Ubuntu Core? Any directions on how to debug this?
Thanks!
EDIT 01
We've tried to stop the apparmor service:
Curiously enough, the apparmor denial message is still appearing after connecting the USBcan device:
I guess this has something to do with the inherent restrictions of Ubuntu Core.
EDIT 02
I'm afraid I can't use
apt
on Ubuntu Core and that there are no snaps for apparmor-utils
. The aa-enforce
and aa-complain
commands are not recognized.I did try to run
systemctl disable apparmor.service
and rebooting. After this, SSH access to the gateway was lost (it's a headless machine with no GPU) and I had to flash the OS image again. I wonder if this has something to do with Ubuntu Core requiring the apparmor
service in order to work properly.The
uefi-fw-tools
snap was installed by default on the Ubuntu Core image that came with the gateway.I'll try to install the
uefi-fw-tools
snap in devmode to try to avoid any apparmor issues and post the results.EDIT 03
After installing the
uefi-fw-tools
snap in devmode the AppArmor DENIED messages disappeared, although the SocketCAN interface still didn't appear when connecting the USBCan device.Can_raw_recv_own_msgs
I contacted Kvaser support and it seems that the USBcan Light is only supported on kernel >= 4.7, while the gateway is running 4.4. The minimum kernel as mentioned in the docs should be 3.2, but this specific model is not supported.
Thanks a lot anyway for your help in debugging AppArmor.
Andrés García Mangas
Andrés García MangasAndrés García Mangas
1 Answer
Don't forget to reboot after loading the kernels.
Sniper tower state of decay 2016. The standard command to configure a CAN bus interface is:
This will set the bitrate of the can0 interface to 500 Kbps.Now bring up the interface and start dumping frames:
or do a
- First I recommend to install apparmor-utils
- In your case
profile='snap.uefi-fw-tools.fwupd'
denies tooperation='open'
name='/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/busnum'
withpid=2327
In your/etc/apparmor.d/snap.uefi-fw-tools.fwupd
add the following line (insert 2 spaces before /sys/.. !) - Reload all apparmor profiles:or if not started/enabledYou can prove the status withor
- I recommend to useThis will made profile violations permitted and logged. Useful for testing and developing new profiles.Later you can set it to enforce with
4,60688 gold badges1717 silver badges3535 bronze badges