cannot SSH beaglebone after changing - linux

In order to get internet through USB from my ubuntu host, I changed routing on beaglebone
route add default gw 192.168.7.1
and change /etc/resolv.conf into
nameserver 192.168.1.1
It gets internet but I cannot ssh beaglebone like before anymore from any host.
Normally I did ssh root#192.168.7.2
but it doesn't return any message or prompt to enter password.Just blank waits there.
I there any way to fix it?

Are you sure that you shouldn't configure /etc/resolv.conf with
nameserver 192.168.7.1
It my happen that the ssh daemon is trying to resolve the reverse of the ip address you're connecting from, and it takes long to timeout, giving you the impression that it does not work.

Related

How to set DNS servers manually?

How do I exclude DNS from the DHCP lease request on a Raspberry Pi?
I tried updating /etc/resolv.conf but it's reset after a while.
Reason: I am on a home network, and the home router uses itself as the DNS server, but the router's DNS service isn't working properly sometimes.
Most of the answers didn't work for me, but I found that this worked:
sudo vi /etc/dhcpcd.conf
Added a line (note that there is no comma):
static domain_name_servers=8.8.8.8 8.8.4.4
And unplugged and replugged my ethernet cable, which updates the resolver...
cat /etc/resolv.conf
Now shows:
# Generated by resolvconf
domain example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
This also a better way to fix the problem where changes to /etc/resolv.conf are lost on reboot.
I asume the problem is, that the dhcpclient is getting new information about DNS servers with every dhcp-renewal. Add this line into /etc/dhcp/dhclient.conf:
option domain-name-servers 192.168.1.8, 8.8.8.8, 8.8.4.4
Of course you should replace the ip-addresses with the ones from your demanded DNS server. Probably restart the according service.

Change hostname of Linux machine

I have a host "india.niksula.hut.fi". I want to change it to "test.india.niksula.hut.fi". I ran the command:
sudo hostname test.india.niksula.hut.fi
I also modified the /etc/hostname file to have "test.india" instead of "india", which was previously the case. When I ran the command:
hostname --fqdn
I get "test.india.niksula.hut.fi". Now, when I am trying to ping that name from another machine, it gives:
ping: unknown host test.india.niksula.hut.fi
SSH also gives the same result. I need to be able to access the name "test.india.niksula.hut.fi". Can anyone help please?
Thanks in advance!
How should the other machine know about the host name at all? Have you a DNS-service running where you store your host mames with the corresponding IP addresses?
So you either run a DNS service or store the host-names with the proper IP addresses in your /ets/hosts on all your machines.

dnsmasq doesn't resolve internal IP address

I have a openwrt router, and a client linux connected to it. I config the dnsmasq with
resolv-file=/tmp/resolv.conf.auto
For example, when I use nslookup on the client, nslookup google.com is OK, but nslookup bd.ysmood.org says No answer.
How to make the router work properly?
OK, since the bd.ysmood.org is an internal IP address. The dnsmasq's rebind_protection will make the lookup fail.
Edit the /etc/config/dhcp, find the line:
option rebind_protection 1
Change the 1 to 0 will do it.

Linux Debian SSH connection to another machine has delay after network settings change

Hi StackOverflow members,
I have an issue with ssh connection on my Debian 7 system to a remote OpenSSH server located on the same network. It looks like there is some network configuration problem but I cann't find where it lays. This two debian machines are connect with a switch that is NOT connected to a router. So the two machines have no internet connection.
A-Debian 7
IP: 192.168.1.2
MASK: 255.255.255.0
GW: 192.168.1.1
B-Debian 7
IP: 192.168.1.3
MASK: 255.255.255.0
GW: 192.168.1.1
With that configuration the ssh command prompts my for a password in less then a second. But the with the following network configuration I get the password prompt after a 10+ second delay:
A-Debian 7
IP: 10.10.1.83
MASK: 255.255.255.128
GW: 10.10.1.1
B-Debian 7
IP: 10.10.1.82
MASK: 255.255.255.128
GW: 10.10.1.1
The ssh connection from the server A -> B runs with both configs on custom 1111 port.
The B machine has also a Web server running on port 8080 that has no delays with both net configurations.
Thank you in advance for any clues or tips how to solve that problem.
SOLVED: Removing of the gateway parameter "GW: 10.10.1.1" in the network settings has solved the problem.
The usual culprits here are IPv6 and DNS lookups.
SSH might try to connect via IPv6, first, but the timeout is too low for that. You can see whether IPv6 is enabled with
cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6
To disable:
echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6
The second culprit is DNS; my guess is that DNS lookups don't work correctly with the second configuration. Try host www.google.com to test this theory.
If that also has a delay, you need to fix your DNS setup.
If that's not it, check the rest of your networking parameters: Gateway, cables, etc.
Start to ping the other host. Is that fast & reliable?
Next, try remote login (ssh, telnet). Note that you can give telnet a port to connect to, so if you have DB server running, you can still use telnet to connect to the server. It will print an error but it allows you to test the TCP/IP connection without any extra error sources.

DNSclient is not picking up hostname from DNSserver but it is able to ping it

I Have Window 7 as Host Machine and I have installed Redhat 5.3 and Centos 5.4 as Vmware Machines under Window 7 through Vmware Workestation.I configure DNS & DHCP in Redhat 5.3(10.0.0.1) and able to do nslookup & DIG in this.I am able to ping window 7,redhat,centos with each other.
I have made one entry client30.example.com for ip 10.0.0.30 in forword and backword lookup file in DNS server(10.0.0.1).
Problem :-
Centos whom i have made dhcp client of Redhat(10.0.0.1) is able to get ip from dhcp server and it gets ip 10.0.0.30 (as i wanted no problem till now)
But Centos is not picking up hostanme client30.example.com as i have bind entry of ip 10.0.0.30 with client30.example.com.
Still it is picking up hostname localhost.localdomain. I check /etc/resolve.conf file of centos and i found that by default it picks nameserver 192.168.1.1(even i have not provided this ip anywhere).Everytime i made manual change in this ip again it pics same ip on reboot.
Kindly help how i can resolve this problem.
Because VMware Workstation is itself DHCP. Please disable DHCP in VMware Workstation, You can't run two DHCP in single network subnet.
Also check /etc/sysconfig/network file, Hostname coming from there.

Resources