Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-10-2006, 02:02 AM
|
#1
|
Member
Registered: Aug 2003
Location: ~/.
Distribution: CentOS
Posts: 290
Rep:
|
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.
|
|
|
05-10-2006, 02:27 AM
|
#2
|
Member
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Pop!_OS && Windows 10 && Arch Linux
Posts: 832
|
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
|
|
|
05-10-2006, 03:29 AM
|
#3
|
Member
Registered: Aug 2003
Location: ~/.
Distribution: CentOS
Posts: 290
Original Poster
Rep:
|
there is no any single command can do so?
|
|
|
05-10-2006, 12:55 PM
|
#4
|
Member
Registered: Mar 2004
Location: Boston, MA
Distribution: SuSE Linux Open/Enterprise, Red Hat, Ubuntu
Posts: 147
Rep:
|
Why would you need to obtain another IP address?
|
|
|
05-10-2006, 01:03 PM
|
#5
|
Member
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929
Rep:
|
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."
|
|
|
All times are GMT -5. The time now is 01:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|