LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 02: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, 02:27 AM   #2
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
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, 03: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, 12:55 PM   #4
NetAX
Member
 
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 147

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

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



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 11:36 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
obtain dns server address automatically mspier Linux - Networking 10 01-11-2004 12:33 AM
unable to obtain ip address from dhcp server (Fedora Core 1) zero79 Linux - Hardware 5 11-15-2003 01:42 PM
dhcp server address manthram Linux - Networking 1 07-12-2002 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:07 PM.

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
Open Source Consulting | Domain Registration