Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
IP always change back to the orginal automatically [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Mon Dec 08, 2014 12:00 am    Post subject: IP always change back to the orginal automatically [solved] Reply with quote

I need to change my mac address to log on a network so that the machine can get ip address.

I usually use

Code:
ifconfig enp6s0 hw ether aa:bb:cc:dd:ee:ff


or

Code:
ip link set dev enp6s0 adress aa:bb:cc:dd:ee:ff


after that, one can see from ifconfig that the address has been changed to the one desired.

But, once dhcp starts off requesting ip, the ip address changes back to the original one the network card has, which results in no ip to the network system .

Gentoo used to work well using the abovementioned method. An recent update has caused this new problem. The UBUNTU system installed in the same computer still can get ip after using the abovementioned command.


Last edited by diablo465 on Wed Dec 10, 2014 10:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Schnulli
Guru
Guru


Joined: 25 Jun 2010
Posts: 320
Location: Bremen DE

PostPosted: Mon Dec 08, 2014 1:08 pm    Post subject: Reply with quote

recompile your Kernel without DHCP-Auto , that would help you if you still want to use DHCPCD, i kicked it bec. the kernel can manage it fine ;)
And dont forget to change/set your Symlinks in /etc/conf.d/ if your still on udev , the udev rules could be as well a reason, check them ;)

<*> Packet socket │ │
│ │ < > Packet: sockets monitoring interface │ │
│ │ <*> Unix domain sockets │ │
│ │ < > UNIX: socket monitoring interface │ │
│ │ <M> Transformation user configuration interface │ │
│ │ [*] Transformation sub policy support │ │
│ │ [*] Transformation migrate database │ │
│ │ [*] Transformation statistics │ │
│ │ <M> PF_KEY sockets │ │
│ │ [ ] PF_KEY MIGRATE │ │
│ │ [*] TCP/IP networking │ │
│ │ [*] IP: multicasting │ │
│ │ [*] IP: advanced router │ │
│ │ [ ] FIB TRIE statistics │ │
│ │ [*] IP: policy routing │ │
│ │ [*] IP: equal cost multipath │ │
│ │ [ ] IP: verbose route monitoring │ │
│ │ [*] IP: kernel level autoconfiguration │ │
│ │ [*] IP: DHCP support ###!! deselect it if you want to use dhcpcd instead │ │
│ │ [ ] IP: BOOTP support │ │
│ │ [ ] IP: RARP support
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Wed Dec 10, 2014 10:29 pm    Post subject: Reply with quote

Thanks, deselecting DHCP support does help to preserve the new ip address.

But Somehow the laptop still can not get ip properly, which may result from some other reason.

I will mark this one solved.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Wed Dec 10, 2014 11:03 pm    Post subject: Reply with quote

I suppose you're trying to use several ways to configure your network at the same time.
If you want to configure it manualy, remove net services from default runlevel.
If you want to configure network with static IP, use init scripts with static IP rather than automagic (e.g. empty config default to DHCP)
If you want to use DHCP set server correctly and don't mess with it manually. Half way through lease's lifetime it will attempt to rebind IP, so you can only be sure your setup will fail, sooner or later.

Finaly, if you use several networks and switch often, using some kind of manager might be the best way for you. There are plenty of those lying around, like networkmanager or wicd.
Pick ONE that suits your need. One. Not 2, not 3. They will conflict, possibly in ways you don't expect, but you will notice when it happens. And you likely will not know what the cause is.
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Mon Dec 15, 2014 1:02 am    Post subject: Reply with quote

Quote:


I suppose you're trying to use several ways to configure your network at the same time.
If you want to configure it manualy, remove net services from default runlevel.
If you want to configure network with static IP, use init scripts with static IP rather than automagic (e.g. empty config default to DHCP)
If you want to use DHCP set server correctly and don't mess with it manually. Half way through lease's lifetime it will attempt to rebind IP, so you can only be sure your setup will fail, sooner or later.

Finaly, if you use several networks and switch often, using some kind of manager might be the best way for you. There are plenty of those lying around, like networkmanager or wicd.
Pick ONE that suits your need. One. Not 2, not 3. They will conflict, possibly in ways you don't expect, but you will notice when it happens. And you likely will not know what the cause is.

Thanks @szatox. I am trying to narronw down where am I and where to go in terms of the three methods to configure network.

I feel that I am under the third method. Currently networkmanager is enabled. but I am not sure how to figure out the commands that will be automatically excuted after the plugging in the network cable. Maybe there are several commands executed at the same time which are muturally conflicting, which causes the system stopped getting IP.
Back to top
View user's profile Send private message
diablo465
Apprentice
Apprentice


Joined: 10 Sep 2013
Posts: 194

PostPosted: Tue Jan 13, 2015 7:46 am    Post subject: Reply with quote

I have disabled the dhcpcd by

Code:
 systemctl disable dhcpcd.service


and disabled DHCP support in the kernel config

after plug in the network cable with changed ip, everything is working fine now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum