Linux - NetworkingThis 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.
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.
As a reference I installed 6.9 in a virtual machine using the netinstall ISO. I setup a static IP address during the install process and selected desktop installation.
After first boot configuration was complete ssh and NetworkManager was running. I modified the /etc/sysconfig/ifcfg-eth0 and since bootproto=static was already configured all I changed was:
NM_CONTROLLED=no
and added nameservers. I don't know why the original DNS entry added during the install was not added to the /etc/resolv.conf on first reboot.
DNS1=XX.XX.XX.XX
DNS2=XX.XX.XX.XX
I disabled networkmanager service from automatically starting and rebooted the VM (again). Since ssh was automatically configured to start by the install process and the firewall allowed ssh traffic those were the only changes. I could login from another computer successfully on my LAN.
CentOS 6 does not use persistent naming so ethernet adapters are still eth0 etc. Explicitly enabling eth0 is automatically performed by the network service.
My only proof is..
Code:
ssh user@192.168.0.30
user@192.168.0.30's password:
Last login: Mon May 8 11:19:44 2017 from 192.168.0.215
You disabled NetworkManager by NM_CONTROLLED=no or with chkconfig?
I made each of those changes. The only error I get is when I issue ifup eth0 or eth1 is:
Yep, I am inclined to believe the OP has left out some details.
I have left NOTHING out. Straight install. Not rocket science. I installed first by not selecting Configure Network and then manually changing the ifcfg files and then by selecting Configure Network.
The only manual changes were changing
BOOTPROTO=static // defaults to none
NM_CONTROLLED=no // defaults to yes
ONBOOT=yes // defaults to no
Since you're now questioning that I haven't given you everything...
the fact that you posted arbitrarily named screenshots, where simple code output would have sufficed, shows me that you aren't taking all this very seriously.
also one should never "just bump" the thread - always provide new insights and developments with every post.
otherwise it might look like you're trying to make us do all the work for you ;-)
the fact that you posted arbitrarily named screenshots, where simple code output would have sufficed, shows me that you aren't taking all this very seriously.
also one should never "just bump" the thread - always provide new insights and developments with every post.
otherwise it might look like you're trying to make us do all the work for you ;-)
No argument, but .. In his defense, you might note that he has posted 95 times since 2009. I have posted nearly 2000 times since 2010 and am not that active, and you have posted over 5000 since 2013. This guy is not terribly active in Linux and may not have taken opportunity to learn the more effective ways to interact here. We might need to guide him a bit.
karzybob FYI: screenshots are effective for examples of gui things or when that information needed is pictorial. Linking to images, or any external file, is a bit disruptive of the reading process and makes extra work for the people who are trying to help. Capturing text is easy, and pasting it into quote or code blocks is very effective. This is the preferred technique when the information is presented terminal based or as a small text file. In this case all of the information could have been presented in quote blocks without using external files. Less work for you AND us.
I tried to go look at those images, and cannot even resolve the hostname now.
Can you summarize the results.
On boot, was that interface up or down? Was sshd listening on port 22 at address 0.0.0.0 or not?
After you manually ifup that interface it does respond and sshd permits connection: is that correct?
No argument, but .. In his defense, you might note that he has posted 95 times since 2009. I have posted nearly 2000 times since 2010 and am not that active, and you have posted over 5000 since 2013. This guy is not terribly active in Linux and may not have taken opportunity to learn the more effective ways to interact here. We might need to guide him a bit.
karzybob FYI: screenshots are effective for examples of gui things or when that information needed is pictorial. Linking to images, or any external file, is a bit disruptive of the reading process and makes extra work for the people who are trying to help. Capturing text is easy, and pasting it into quote or code blocks is very effective. This is the preferred technique when the information is presented terminal based or as a small text file. In this case all of the information could have been presented in quote blocks without using external files. Less work for you AND us.
I tried to go look at those images, and cannot even resolve the hostname now.
Can you summarize the results.
On boot, was that interface up or down? Was sshd listening on port 22 at address 0.0.0.0 or not?
After you manually ifup that interface it does respond and sshd permits connection: is that correct?
I used screen shots from my KVM because in order to show you TEXT I'd have to use ifup and bring the port up. I was specifically asked for before and after. I'm really not trying to be a butt and I HAVE tried learning Linux. I know my fair share but this appears to be a bug. I have left nothing out. I installed the first time by breezing through and then edited the ifcfg-eth0 and 1 files manually to ONBOOT=yes, BOOTPROTO=static NM_MANAGER=no. That should have worked but did not. The broadcast address was automatically calculated correctly for our /23. When the ports would not come up through SSH I used ifup eth0 and ifup eth1. THEN I could copy text AFTER the failure. I can view the graphics clearly. I'm sorry that you cannot. Really. I do hesitate to publicly post the IP or hostname because someone knowing the OS version could also know how to get root access. My second installation I used Configure Network and it created the ifcfg files but did not change BOOTPROTO to static. FWIW, I know how to use quote and code. I've run vBulletin for 15 years on a personal site. Not that it mattered (it doesn't) we sit behind an enterprise firewall with a 1Gbs connection. Port 22 is open but restricted to our IP's. We can get into older servers just fine. The fact that ifup remedies the issue says it isn't the firewall. It's a setting or a bug or older hardware. I know that a hacker can use Plesk and a malformed URL to upload a file and then execute it in /tmp even though we've taken steps. Not related.
Our first servers were Cobalt's. It may not seem like it but I've setup many servers going back to CentOS 3 and Virtuozzo 3. Virtuozzo IS NOT YET on this server so that has no bearing. I really need help but my experience using message boards and Facebook is one often gets sarcastic replies like, "You should already know..." or as I've already read elsewhere, "Why are you using version... It was a sub release that can be easily rooted!" Good point but I am trying to rescue files. I am trying to be humble and open to learning.
To answer your question the ports are UP but not accessible via ssh. Reading CentOS they tell you that by default ssh access is off. Not the port - ssh. If I place a text file in /var/www/html and apache is running (it is) the text file comes up. I just cannot ssh into the box until using ifup. I WAS trying to answer the questions presented. My KVM (Avocent 3100) does not allow me to highlight text. I tried adding a line to rc.local and it did not work. I removed it (ifup eth0)
I manage a TRUE 501(c)(3) hosting company that used to have a Sys Admin. He left the state and I became the guy because I've been a prolific programmer for more than 35 years. I was a Windows/DOS guy. I have learned Linux based on need, Virtuozzo and Plesk. I even took an online course with live interaction. We are moving to managed servers at a server farm but our billing/DNS server crashed without warning. Nothing but machine code on /sda1. I wasn't aware that server had RAID active and expected /hda1. The servers are 10 year old Super Micro dual AMD Opteron 279's with 3Ware RAID (except the failed server I think.) The backup files are OS specific and the reason we're trying to install an older version - to rescue orphaned files. Virtuozzo 4 and below have a known issue with consistency and failed backups not reporting errors. No repo's available but trying anyway. I can copy ez-templates from another server with rsync but only after using ifup or the KVM. I put it in a screen. I mention these things to show that I am not a blundering idiot.
I asked at Centos and was ridiculed. "Use 6.9..." It also has the same SSH limitation. I sincerely apologize that I cannot articulate the issue any better. But I am not trying to be rude or difficult. I am asking for help.
to make ssh start on boot?
This should work on any version 6 of RHEL or CentOS. Version 7 is a little different, I believe.
No matter how service sshd becomes disabled (manual or by default) this sets it to start on boot.
Nothing I see on your provided information indicates that the port is down. IT appears up in the before and after. The only other thing I can think might cause the symptoms is if sshd is not really listening. Setting it to autostart using the above technique will not hurt anything. If it is already starting nothing will change. If it is NOT starting, this will force the issue and make things work.
This is absolutely bizarre! I decided that instead of screen caps that aren't helpful to some I would pipe the text files BEFORE USING IFUP to other text files that would not be changed AFTER USING IFUP. I named them
I turned off the progress bar for CentOS booting and could then see that it was stalling at ntpdate even though it says that the interface is up. But pinging yahoo.com or any other site fails as if there is no NIC. Oddly enough I could ssh into the box on the private 192.168.220.0 network used for backups. But that is from behind the firewall. I have all of my IP's in the firewall (/29) and can access any server behind it in the /23 including this server before it failed and got new drives. CFS is not running or any other software based firewall. Virtuozzo is specific about this and even SELINUX must be off. I can also login from our proxy server at my home that allows emergency SSH access via tablet/cellphone/laptop with a dynamic IP.
I am stumped.
Quote:
On running "ifup eth0" (or eth1) I got the following error:"RTNETLINK answers: File exists"
[root@hw001 ~]# netstat -rn AFTER IFUP
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.220.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
65.44.220.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 65.44.220.1 0.0.0.0 UG 0 0 0 eth0
The interface DOES ANSWER from outside of the server.
PING 65.44.220.11 (65.44.220.11) 56(84) bytes of data.
[root@hw002 cgi-bin]# ping hw001.controlservers.net <<== DNS is working and finds the hostname
PING hw001.controlservers.net (65.44.220.11) 56(84) bytes of data.
64 bytes from 65.44.220.11: icmp_seq=0 ttl=64 time=0.819 ms
64 bytes from 65.44.220.11: icmp_seq=1 ttl=64 time=0.098 ms
64 bytes from 65.44.220.11: icmp_seq=2 ttl=64 time=0.122 ms
64 bytes from 65.44.220.11: icmp_seq=3 ttl=64 time=0.106 ms
[root@hw001 log]# cat boot.log
GG Welcome to CentOS
Starting udev: G [ OK ]
Setting hostname hw001.controlservers.net: [ OK ]
Setting up Logical Volume Management: No volume groups found
[ OK ]
Checking filesystems
/dev/sda1: clean, 47659/960992 files, 495320/3840000 blocks
/dev/sda3: clean, 11/59555840 files, 3789064/238200576 blocks
[ OK ]
Remounting root filesystem in read-write mode: [ OK ]
Mounting local filesystems: [ OK ]
Enabling local filesystem quotas: [ OK ]
Enabling /etc/fstab swaps: [ OK ]
Entering non-interactive startup
Calling the system activity data collector (sadc):
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
fgrep: ifcfg-ifcfgeth0before.txt: No such file or directory <<=== ???
fgrep: ifcfg-ifcfgeth0before.txt: No such file or directory <<=== ???
fgrep: ifcfg-ifcfgeth0before.txt: No such file or directory <<=== ???
Bringing up interface ifcfgeth0before.txt: [ OK ] <<===
Starting auditd: [ OK ]
Starting portreserve: [ OK ]
Starting system logger: [ OK ]
Starting irqbalance: [ OK ]
Starting rpcbind: [ OK ]
Starting NFS statd: [ OK ]
Starting RPC idmapd: [ OK ]
Starting mcelog daemon
Starting kdump: [ OK ]
Starting system message bus: [ OK ]
Mounting other filesystems: [ OK ]
Starting acpi daemon: [ OK ]
Starting HAL daemon: [ OK ]
Retrigger failed udev events [ OK ]
Loading autofs4: [ OK ]
Starting automount: [ OK ]
Starting sshd: [ OK ]
ntpdate: Synchronizing with time server: [ OK ]
Starting postfix: [ OK ]
Starting abrt daemon: [ OK ]
Starting Qpid AMQP daemon: [ OK ]
Starting crond: [ OK ]
Starting atd: [ OK ]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.