How do you reliably get an IP address via DHCP? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I work with embedded Linux systems that sometimes want to get their IP address from a DHCP server. The DHCP Client client we use (dhcpcd) has limited retry logic. If our device starts up without any DHCP server available and times out, dhcpcd will exit and the device will never get an IP address until it's rebooted with a DHCP server visible/connected. I can't be the only one that has this problem. The problem doesn't even seem to be specific to embedded systems (though it's worse there). How do you handle this? Is there a more robust client available?

The reference dhclient from the ISC should run forever in the default configuration, and it should acquire a lease later if it doesn't get one at startup.
I am using the out of the box dhcp client on FreeBSD, which is derived from OpenBSD's and based on the ISC's dhclient, and this is the out of the box behavior.
See http://www.isc.org/index.pl?/sw/dhcp/

You have several options:
While you don't have an IP address, restart dhcpcd to get more retries.
Have a backup static IP address. This was quite successful in the embedded devices I've made.
Use auto-IP as a backup. Windows does this.

Add to rc.local a check to see if an IP has been obtained. If no setup an 'at' job in the near future to attempt again. Continue scheduling 'at' jobs until an IP is obtained.

Related

Configure isciadm to fall back to another iscsi-portal if one is down [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
Let's say I have a 100G disk which i want to expose as an ISCSI-target and I have configured 2-ISCSI-portals(IP1, IP2) which can be used to access the ISCSI-target
Note: I have used more than one portal for my High-Availability Use-cases
Let's say, From the Host, I have used IP1 for the login to the ISCSI-Target and am able to connect to the target successfully. After some time Say, because of some reason IP1 is down.is there a config/way to specify the ISCSIADM to fall back to IP2 for connecting to ISCSI-target
As stark says in the comments above, the answer is to use dm-multipath. There are numerous articles on how to set this up, but the short answer is that it'll likely "just work".
First, install multipathd on your system. Then, when you use iscsiadm in discovery mode, so long as your iSCSI target reports both portals, Linux is going to connect to both portals. You'll get two block devices, both with the same SCSI WWN. Multipathd wakes up, sees the two devices with the same WWN, and bundles them into a /dev/dm-X device for your use. From that point forward, multipathd manages the paths according to how you've configured its policy. The default may be fine for your use.
The key point here is that iscsiadm and iSCSI are kind of "out of the way". You'll have a session for each path. The sessions may come and go. DM-Multipath manages which sessions are involved in providing access to your LUN.

Can a hacker spoof any IP address of his choice? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
For example.
Lets say we have the following linux server:
host-server: 54.215.128.59
This servers will only accept connections from the following ip : 159.65.32.123
If a hacker only knows this information.
Could he be able to trick the host-server that the conection is coming from 159.65.32.123?
This way he would be jumping any firewall established.
It isn't very likely. Nothing is stopping you from defining you own IP address to whatever you want. In linux you can do it with (assuming you network interface is eth0):
sudo ifconfig eth0 159.65.32.123/24
If you are behind a NAT then you'll have to change its address and not yours. However, ISPs should have anti-spoofing measures in place that block packets with an IP address they didn't assign you.
There is also the problem of the return path. When the server will want to send something to this address, the packet will be routed according to the routing rules of all the nodes in the way, which are unlikely to point to the hacker's ISP.
If you are on a LAN with the server then it should be more possible, though you will likely need to handle the collision of IP addresses, and the problem of spoofing IP addresses on a different subnet. One option is to use ARP poisoning and do a MitM between the server and the router.

Connecting WinSCP with Ubuntu on VirtualBox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm trying to connect Winscp with virtual machine. I'm working on Windows,and this problem is killing me for 5 hours. Studied a lot of examples, but I can't find out what is the problem. I tried to connect with putty to, but connection is every time refused. Tried to connect with every protocol, but didn't help. I even can't install ssh into Ubuntu, because something is blocking but not firewall(failed to fetch us archive ubuntu com). Port forwarding too wasn't very helpful.
1st Adapter is NAT, and second host-only.
Problem is that I need to enter home directory, and add some files, so I'm trying to find the easiest way to do this.
I would really appreciate any help. Here is my ifconfig, ip a, and interfaces picture.
1
Thanks!
Use the following step to configure.
1- Run ipconfig /all on your windows machine and see which ip are assigned to your virtual adopters.
2- Assign the same range ip to your virtual machine. For example:
If on virtual adopter ip is: 192.168.130.1
Then assign ip to your vm as: 192.168.130.*
and set gateway to : 192.168.130.1
and restart the service network and check the reachability by pinging from both side.
3- If You able to ping then you will be able to use internate on your VM. Then install the ssh.
Now you will be able to use.

PXE Won't boot with new version of Boot agent [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
We are running WDS on server2012 and it's doing fine with older machines. But we bought new stack of HP's with Intel i217-lm NIC, it is using Boot agent GE v.1.5.50.
When we are trying to boot it gets ip via dhcp, but ends with error:
PXE-E55: ProxyDHCP service did not reply to request on port 4011
I tried to change dhcp scope options by MS recommendations:
Option 60= PXEClient
Option 66= WDS server name or IP address
Option 67= Boot file name
Any suggestions
To see if the DHCP process is where the problem lies, one test to try is running Wireshark on the DHCP server to see if the packet was received by the server, and if the server sent the packet back to the i217 adapter.
If the packet reached the DHCP server but didn't get sent back maybe it is a firewall issue. I would also check the IP address leases and make sure everything looks error-free (ie no duplicate IPs, bad addresses).
Also if you want to verify that there are not known PXE issues with the i217 adapters, or if there any quirks, you can ask the Wired Ethernet blog at communities.intel.com about the issue you're seeing. They usually have someone who can help from Intel on there.
Workaround was booting from network in UEFI mode. There is limitations regarding new Intel's boot agent

Fastest way to achieve DHCP on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Motivation: I run wpa_supplicant without a network managing tool because I don't want to force new DHCP leases when my old ones work. This way I can get onto an old network very fast (as soon as wpa_supplicant establishes the lower network layers) if the DHCP lease has not expired.
Problem: But when the DHCP lease has expired, or if my IP address is from another network, I do need to call upon DHCP. I currently use dhclient, but dhcpcd is another option here. The problem is, even though these DHCP clients run in the background, they don't automatically realize that I need a new IP address, since I've got an old, invalid one.
Question: Is there a way to very quickly determine if I'm in need of DHCP? E.g. as a reaction to wpa_supplicant or as a response to contacting the standard gateway and realizing a connection isn't available. I can easily run sudo dhclient wlan0, and it gives me the address in one second. But what can I do to automate this process, when necessary?
Making unnecessary DHCP requests is not out of the question, but flooding the DHCP server is.
Elaborate question: For those of you who use wpa_supplicant directly, how do you DHCP?
Run dhcpcd again whenever you attach to a new network. If you have an existing lease it should be confirmed quickly.
If you object to typing in "dhclient" or "dhcpcd" everytime, you could automate it with a shell script. It could look something like
#!/bin/sh
dhcpcd wlan0 &
wpa_supplicant -d -c/etc/wpa_supplicant.conf -iwlan0
dhcpcd will say it is "waiting for carrier" until wpa_supplicant brings up the wireless link.

Resources