# Change ip and mac

**URL:** <https://www.ruby-forum.com/t/change-ip-and-mac/119421>\
**Category:** Ruby\
**Created:** [November 6, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421 "2007-11-06T21:57:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 6, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/1 "2007-11-06T21:57:15Z")

</div>

how can i change my ip and mac address?  
tnx

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 6, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/2 "2007-11-06T22:57:49Z")

</div>

Bulhac M. wrote:

> how can i change my ip and mac address?  
> tnx

If you are using dhcp, you can simply move to another country and plug  
your computer in… voila … new ip!

As for changing the mac address, you can always buy a new nic… (If it  
will be hard to acquire it in the new country you move to, make sure to  
buy one before you leave)

hth

ilan

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 6, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/3 "2007-11-06T23:31:31Z")

</div>

¿¿from source code ruby?? 😑

well ,  
if you use un debian distro, from console this are steps

1. #: apt-get install lshw  
#: lshw | less

\*-network  
description: Ethernet interface  
product: 88E8053 PCI-E Gigabit Ethernet Controller  
vendor: Marvell Technology Group Ltd.  
physical id: 0  
bus info: pci@0000:03:00.0

> > > > > > > > logical name: eth0\<\<\<\<\<\<\<\<\<\<

if is “eth0” your netcard then

1. #: macchanger --mac “00:5D:6E:4D:5W:4B” eth0

where “00:5D:6E:4D:5W:4B” is the new mac address

and then

1. you going to edit “/etc/network/interfaces”

iface eth0 inet static  
address “10.1.1.15” ##====\> “YOUR NEW IP ADDRESS”  
netmask “255.255.255.0”  
network “10.1.1.0”  
broadcast 10.1.1.255  
gateway 192.168.1.2

maybe this question is apropiate for other list of distros linux if  
you not want do this from source code Ruby. I don’t write english very  
well, sorry!! i hope you understand my explanation. bye

* * *

[http://www.sindominio.net/ayuda/preguntas-inteligentes.html](http://www.sindominio.net/ayuda/preguntas-inteligentes.html)  
[http://cronopios.net/Traducciones/trolls.es.html](http://cronopios.net/Traducciones/trolls.es.html)

Mi blog:  
[http://enjoyingfreesoftware.wordpress.com/](http://enjoyingfreesoftware.wordpress.com/)

:-{þ

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 7, 2007, 7:13am UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/4 "2007-11-07T07:13:15Z")

</div>

no…i don’t want to change my card and so on:), i want to change ip and  
mac from ruby code if this is possible

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 6, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/5 "2007-11-06T23:55:31Z")

</div>

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).  
> For any \*nix like OS:

Change the MAC address  
ifconfig eth0 down && ifconfig eth0 hw ether 00:00:00:00:00:01 &&  
ifconfig  
eth0 up

Change the IP address  
ifconfig eth0 down && ifconfig eth0 192.168.1.2 netmask 255.255.255.0 &&  
ifconfig eth0 up

See “man ifconfig” for details

HTH,

Felix

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 7, 2007, 7:52am UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/6 "2007-11-07T07:52:00Z")

</div>

Quoth Bulhac M.:

> no…i don’t want to change my card and so on:), i want to change ip and  
> mac from ruby code if this is possible

Short answer: no.

---

<div class="post-metadata">

**Author:** ![mihai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/35a633/32.png) [@mihai](https://www.ruby-forum.com/u/mihai)\
**Post date:** [November 7, 2007, 8:29am UTC](https://www.ruby-forum.com/t/change-ip-and-mac/119421/7 "2007-11-07T08:29:29Z")

</div>

Quoth Konrad M.:

> Quoth Bulhac M.:
> 
> > no…i don’t want to change my card and so on:), i want to change ip and  
> > mac from ruby code if this is possible
> 
> Short answer: no.

Long answer: no.
