LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 05-10-2006, 03:02 AM   #1
ICO
Member
 
Registered: Aug 2003
Location: ~/.
Distribution: CentOS
Posts: 290

Rep: Reputation: 30
How to obtain another IP address from DHCP server


My linux machine obtains IP address by DHCP. Anyway, I just want to know how to obtains another IP address rather than the current one from DHCP server?

Thank you.
 
Old 05-10-2006, 03:27 AM   #2
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Dual boot :: Slackware 14.1 64bit multilib | Kali linux 64bit multi lib
Posts: 192

Rep: Reputation: 43
I spoof my mac every time I reboot so I get new ip.
New mac = new ip.
Code:
#!/bin/sh
#********************************************************************************
# AUTO MAC SPOOF
# BY: THEGREATVIRUS
# Usage: macspoof <device>
## BASE SETTINGS
INTERFACE="ath0"
MAC="$(od -An -t x1 -N 5 /dev/urandom | sed 's/^/00/;s/ /:/g;q')"

if [ "$#" -eq 1 ]; then
	INTERFACE="$1"
fi

## MAC SPOOF
if [ "$INTERFACE" = "ath0" ]; then
	ifconfig $INTERFACE down >/dev/null
	wlanconfig $INTERFACE destroy >/dev/null
	ifconfig wifi0 hw ether $MAC >/dev/null
	wlanconfig $INTERFACE create wlandev wifi0 wlanmode managed >/dev/null
	ifconfig $INTERFACE up >/dev/null
else
	ifconfig $INTERFACE down >/dev/null
	ifconfig $INTERFACE hw ether $MAC >/dev/null
	ifconfig $INTERFACE up
fi

## OUTPUT
echo "Using Device: $INTERFACE"
echo ""
ifconfig $INTERFACE
echo DEVICE: $INTERFACE MAC: $MAC STATUS: UP
 
Old 05-10-2006, 04:29 AM   #3
ICO
Member
 
Registered: Aug 2003
Location: ~/.
Distribution: CentOS
Posts: 290

Original Poster
Rep: Reputation: 30
there is no any single command can do so?
 
Old 05-10-2006, 01:55 PM   #4
NetAX
Member
 
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 146

Rep: Reputation: 16
Why would you need to obtain another IP address?
 
Old 05-10-2006, 02:03 PM   #5
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 927

Rep: Reputation: 30
There really isn't, no...You can assign your NIC a static IP address if you don't like the one that your DHCP server is assigning you, but the point of a DHCP server is that it assigns IP addresses as it sees fit. You can't really say "No thanks, I don't think I like this one, give me another."
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wireless card cannot obtain IP address from DHCP server kswitch Linux - Wireless Networking 6 11-06-2005 12:36 PM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 11:33 AM
obtain dns server address automatically mspier Linux - Networking 10 01-11-2004 01:33 AM
unable to obtain ip address from dhcp server (Fedora Core 1) zero79 Linux - Hardware 5 11-15-2003 02:42 PM
dhcp server address manthram Linux - Networking 1 07-12-2002 04:09 PM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration