Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Linux (in fact just installed it last night). I am setting up my internet. I made a switch from Windows 7 to Linux in order to learn it.

On Windows 7 I was accessing the internet by spoofing my mac address with the mac Address of guy who use to live in my room before. When I changed my mac address all the settings were automatically configured (IP address, subnet mask, default gateway). I tried the same approach with Linux today. I changed the mac address of my ethernet card, but unfortunately it isn't working for some reason. When I checked the settings I found that although my IP address as well as my subnet mask were configured automatically, the same as were on Windows, for some reason my default gateway was (on Windows it used to be

Now since I am not a network expert I don't exactly know what the hell this means. I wonder if maybe Linux users are assigned a different Gateway than Windows users? (I don't even know if this Statement makes sense since I don't have any idea of networks)

What can I do to troubleshoot this?

share|improve this question
Are you connecting wireless or a by cable? – coffeMug Dec 22 '13 at 17:52
I am using cable... – Hamza Khan Niazi Dec 22 '13 at 22:35

(If you previously use other method to change MAC address than this, restore them back to the default settings)

For Kubuntu, there's a "Network Manager" icon on the right side of the bottom bar(or panel, which a KDE icon is on the left). Click on it, then click on the connection that is active you should find a way to edit the connection settings. At last fill in the spoofed MAC address into the "Cloned MAC address" textbox of the "Wired" tab.

Connection setting dialog
Note: The "Restrict to device" textbox should be remain blank if you don't know what it means. If it's not blank, make it blank.

share|improve this answer

As you didn't mention which linux you're using I'll just assume you're using something with the ip utility(new debian or ubuntu or arch linux). To change your default gateway type ip route del default via this deletes your current default gateway. Then add the new one: ip route add default via

If you aren't 100% sure your MAC-Spoofing worked try ip link show there should be multiple lines, one starting with 1: lo and one starting with 2: eth0 or enp2s0 or something equal, this is your NIC. the link/ether field shows your mac-address if it isn't spoofed correctly first off shut down the NIC: ip link set eth0 down then sppof the mac ip link set dev eth0 address XX:XX:XX:XX:XX:XX and then set the interface back up ip link set eth0 up Note: you might have to change eth0

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.