/etc/resolv.conf Vs DNS1="x.x.x.x" In Redhat

In simple terms what is the difference between the two and what takes precedence?
In my experience the /etc/resolve.conf file will win out but I have seen when we get network issues that the network interface will use its own configuration file.

Does the interface hold this information somewhere in its cache when it starts up?


Similar Content



Network Configuration For Redhat 7

I just installed Redhat 7 and try to config the network , add the IP address to network card , but I got the problem.

I modify the file /etc/sysconfig/network-scripts/ifcfg-enp0s3 , the configuration is as below , and then reboot .

DEVICE="enp0s3"
NETBOOT="yes"
HWADDR="08:00:27:15:38:B7"
TYPE="Ethernet"
BOOTPROTO="none"
NAME="enp0s3"
UUID="462f4834-4fe7-43a7-84e7-83b2722e94c1"
ONBOOT="yes"
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"

After reboot , I use "ip addr show" still not shown the ip address , the ip address is still blank , would advise what is wrong ? thanks

Resolve Configuratin

Hello Gurus,

I am trying to understand the concept of resolve conf and hope to get some understanding.
When reviewing a sample resolv.conf @
http://www.shellhacks.com/en/Setup-D...nf-in-Examples

stumbled on a scenario.

Lets say I have the following in my resolv.conf

less /etc/resolv.conf
search uncc.org uat.uncc.org sit.uncc.org uat2.uncc.org
intranet.uncc.org
nameserver 192.168.0.100

now if I run command, Note: There is no such thing called appserver
Quote:
ping appserver
My Questions:

1 ) How many lookups are being performed. And which domains are being searched ?

2 ) Will the look up go thru all the 5 domains listed against search directive ?

3) When both directives are provided "search" and "nameserver" will the look up happen on both directives and can both directives be used together ?

Help is much appreciated.

Regular Expression In Expect Script To Prevent Printing To Screen

Hello, I have an expect script where I ssh to a remote host to determine the network configuration and get from the user the network interface card that should be used. From their response, I determine the subnet mask and save the information to a text file that is later transmitted back to my local host. This is all so that I can set up virtual IP aliasing and verify that the physical IP address of the local and remote host are on the same subnet prior to continuing with the setup. I am running the script on Linux, with expect version 5.45.

The code itelf works just fine, but I'm having some issues with how it displays on the screen. As you'll see below in the example, the default system prompt displays, as does the user input command that I'm sending to the shell from the expect script.

Is there a regular expression or something that I can write to prevent the prompt and command that I'm sending from printing to the screen? I know that it should be suppressed if I have an expect command following the Code:
send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r

command, but everything I have tried for strings and regular expressions to expect causes the netstat -rn output to not show up all of a sudden. I'm new to expect, so I'm not really sure why this is happening.

I would really appreciate any help/suggestions. Thanks for your time!

Part of the Script Code:
Code:
expect {
   -re $prompt {   ;# Send individual commands and get user input
        set timeout -1
        
        # Get partner hostname and put in vipsetup.txt file
        send -s "hostname > vipsetup.txt\r"  
        expect -re $prompt
        
        # Display the network routing info for the user and prompt for 
        # network interface card number
        send -s "print \"The network routing table for the $ptner server is displayed below:\n\" ; netstat -rn \r"
        
        expect -re "\r(.*):\r"
        send -s "\nread n_card?'Enter the network interface card number for this server (i.e. eth0):   '\r"
        interact "\r" return    ;# Wait for user input from read command
        send -- "\r"
        send -s "echo \$n_card >> vipsetup.txt\r"  
        
        # Obtain subnet mask information for partner based on network 
        # interface card number being used
        send -s "msk=\$(cat /etc/sysconfig/network-scripts/ifcfg-\$n_card | grep NETMASK)\r"
        send -s "msk=\$(echo \${msk#NETMASK=})\r"
        send -s "echo \$msk >> vipsetup.txt\r"
    }
    timeout {
        send_user "Connection to host $hostip timed out."
        exit 6 
    }
    eof {
        send_user "Connection to host $hostip failed."
        exit
    }
}


Script Output:
Code:
The network routing table for the PRIMARY server is displayed below:
 
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.105.65.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         10.105.65.1     0.0.0.0         UG        0 0          0 eth0
 [root@remotehost root]$
[root@remotehost root]$ ber for this server (i.e. eth0):   '              < 
Enter the network interface card number for this server (i.e. eth0):   eth0

Upgrade From Squeeze To Wheezy Network Issue

I recently decided to upgrade from Debian Squeeze to Wheezy. Update seemed to go fine with the exception of the following warning concerning my Broadcom bmc5704 gigabit ethernet cards

Quote:
W: Possible missing firmware /lib/firmware/tigon/tg3_tso5.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3_tso.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3.bin for module tg3
No problem I will simply install the missing .bin files after the upgrade. Get the .bin files from the Debian repository and install them using the command "dpkg -i file_name.deb" then ran "apt-get install -f" for good measure. Still nothing, I have downloaded the following files and running that same command for each hoping that this would solve my compatibility issue with no such luck.

Quote:
firmware-bnx2_0.36+wheezy.1_all.deb
firmware-bnx2x_0.36+wheezy.1_all.deb
firmware-linux-nonfree_0.36+wheezy.1_all.deb
firmware-linux-nonfree_0.36+wheezy.1~bpo60+1_all.deb
When I attempt to go into System Preferences > Network I get the message "The system network services are not compatible with this version."

I showed the hardware using the lshw command and here is the entry concerning the ethernet interface

Quote:
#output from lshw command

*-network:0
description: Ethernet interface
product: NetXtreme BCM5704 Gigabit Ethernet
vendor: Broadcom Corporation
physical id: 2
bus info: pci@0000:02:02.0
logical name: eth0
version: 10
serial: 00:13:21:b2:cf:46
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pcix pm vpd msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.116 duplex=full firmware=5704-v3.41, ASFIPMIc v2.36 ip=XX.XX.XX.154 latency=64 link=no mingnt=64 multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:25 memory:fdf70000-fdf7ffff
Network file configuration.

Quote:
# Network file

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address XX.XX.XX.XX
netmask 255.255.255.0
network XX.XX.XX.0
broadcast XX.XX.XX.255
gateway XX.XX.XX.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers XX.XX.XX.XX 8.8.8.8
dns-search XXXXXXX.net
Server is an older HP ProLiant and I am attempting to put Wheezy on it from a direct upgrade from squeeze.

At this point I am stumped. Not sure exactly what to do but it seems like a fairly simple fix. If anyone has any suggestions I would sure appreciate the help. Let me know if you need anything.

Network Manager Kali Linux 1.1.0 Not Work

Hi everyone, I am a new member and also new to linux, I encountered a problem, but last week I tried but did not solve
I downloaded iso file linux 1.1.0 on page potassium https://www.kali.org, I installed on my Dell inspiron n4010, it works very well and does not have any errors, but after I update and upgrade all packages, I rebooted the system switches to the command line, I lost a lot of time to return to the graphics, but when booting up the network manager icon not seen, I have set the package network-manager-gnome_0.9.4.1-0ubuntu2_i386.deb network manager icon show but when click on the network manager icon only contained text "network manager is not running."
I also installed Wicd but could not run "could not connect to wicd's D-Bus interface. Check the wicd log for error messages."
wireless driver apparently was set before
root@kali:~# airmon-ng
PHY Interface Driver Chipset

phy0 wlan0 wl Broadcom Corporation BCM4313 802.11b/g/n (rev 01)

please help me!
please guide installed offline, my kali linux no internet connection. can download package from another machine to install.

Syntax Error: Unexpected End Of File

Hi!
I wrote a script shell about changing IP of the httpd.conf from text file and saving a new httpd.conf file for all IPs in the text file. The code is below, Im using mremote on windows (RHEL Release 5.7), and getting this error:
./script1.sh: line 19: syntax error: unexpected end of file

Please help me about that error. Thanks!

(ps: line 19 is the last line in the code => done < "$filename" )

#!/bin/bash

DATE='date +%Y%m%d_%H:%M:%S'
NAME=httpd_ip_change
EXTENSION=conf
max=10

filename="$1"
while read -r line

for ((i=2; i<=$max; ++i ))

do
touch $NAME$i.$EXTENSION.$DATE

sed "s/<VirtualHost 10.11.92.81:80>/$line/g" ./httpd.conf > $NAME$i.$EXTENSION.$DATE

done < "$filename"

Failed To Bring Up Eth1 - Debian Wheezy

Hi,

I tried to configure my ethernet interface on a Debian Wheezy VM, but I've a problem. When I try to restart /etc/init.d/networking, I've no error message.
But my eth1 interface isn't up and when I try to up it with : ifup eth1, it return me :

Code:
root@debian-main:/# ifup eth1
RTNETLINK answers: File exists
Failed to bring up eth1

My /etc/network/interface file is :

Code:
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp


iface eth1 inet static
        address 192.168.10.1
        netmask 255.255.255.0
        gateway 192.168.10.254

Eth0 is my internet interface and eth1 is a local interface. I want to install a DNS and a DHCP server on eth1 to be able to connect client with this VM and give them an ip adress.

Thanks guys

Dhcpd On Opensuse 12.1 Does Not Hand Out Addresses

Hi all

I am trying out this dhcp server setup on opensuse 12.1 but it does not seem to be working.

I have eth0 configured to be 192.168.10.1 in a /24 network.

I want to hand out the rest of the address in the same subnet as dhcp addresses. (So everything from 10.2 to 10.255). The default gw is defined as 192.168.10.1, and routing table looks correct. and I only have eth0.


When I start the dhcp, and connect it to the client machine, I see nothing on the wireshark trace. no DHCP discovery or ack messages. And the client machine just keeps trying boot from the network via the network interface. I know I got the right interface (there were blinky options in the bios that lets you identify the correct interface) and the cable is not a problem. (If the cable were a problem the client boot message would say "media fault ... please check media...") instead.

Here is my dhcpd.conf file. I went through man dhcpd already, and cleaned out everything that I apparently don't need. (The original file was copied from a more complicated setup that had multiple subnets and dhcp relays.)

Code:
###################simplfied 
linux-kzy1:/var/lib/dhcp/db # cat /etc/dhcpd.conf
authoritative;

ddns-update-style none;
ddns-updates off;

#Information about the host
subnet 192.168.10.0 netmask 255.255.255.0 {
  max-lease-time 600;
  default-lease-time 600;
  range 192.168.10.2 192.168.10.255;
}

group esx_gep{
  filename "pxelinux.0";
  next-server 192.168.10.1; 
  host testserver1 {hardware ethernet a0:d3:c1:f7:f2:64;}
}

this is what /var/log/message and /var/log/rc.dhcpd.log says:
Code:
**************var log message
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #


*****************var log rc.dhcpd.log
Mar 19 18:42:17 linux-kzy1 dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Mar 19 18:42:17 linux-kzy1 dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Mar 19 18:42:17 linux-kzy1 dhcpd: All rights reserved.
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #

not very interesting stuff or useful, but I found some other messages that is very interesting:

Code:
**********
#no free lease

linux-kzy1:/home/test/Documents # cat /var/log/messages | grep "free lease"
Mar 19 15:53:59 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:03 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:11 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
......
Mar 19 17:01:06 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 17:01:38 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
linux-kzy1:/home/test/Documents #

Which ties into my first question: dhcp no free lease: I googled a bit, I found a post from a guy on ubuntu who has the same error message and the suggested course of action is to change ownership of the lease file to dhcpd and give it 777 for permission. Which I thought is weird, because the lease file is automatically created by the dhcpd itself, so it really shouldn't be a permission issue shouldn't it? (Anyway, tried that didn't do a thing.) right now it is owned by root/root and has this permission: -rw-r--r--.

2nd question: once the client gets a reply from my dhcp server saying no free lease, does it remember this dhcp server as no free lease and does it persist throughout reboots? Because I tried rebooting the client a number of times and I don't see anything on the wireshark at all. You will notice the time stamp on the last "no free lease" message is not as late as the other messages from the var/log/messages or rc.dhcpd.log and I rebooted the client and the dhcp plenty of times since 17:01:38.



Thanks for all your help in advance everyone.

Bad Subnet/netmask , DHCP Installation

Hi,

I'm on WMware workstation with debian Wheezy.
I have a problem when a restart the Dchp.
It said Bad subnet number/mask combination.

This is logs:

root@debian-main:/# /etc/init.d/isc-dhcp-server restart
dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
The error was:
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
/etc/dhcp/dhcpd.conf line 50: subnet 192.168.10.1 netmask 255.255.255.0: bad subnet number/mask combination.
subnet 192.168.10.1 netmask 255.255.255.0{
^
Configuration file errors encountered -- exiting

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.

And this my file dhcpd.conf:

# A slightly different configuration for an internal subnet.
subnet 192.168.10.1 netmask 255.255.255.0{
range 192.168.10.1 192.168.10.15;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
option routers 192.168.10.254;
option broadcast-address 192.168.10.255;
default-lease-time 600;
max-lease-time 7200;
}

For me it's the good subnet number/mask combination.

Can you help me please?

Thanks you,

Pierrick

Detect NIC Interface In Linux

Dear Friends ,

One of My linux server , I have 4 NIC card . I plugged a network cable one of NIC card . Now How can I understand which interface (eth0 or eth1 or eth2 or eth3) is connected with the cable ?

Which command I need to use to find it ?


My second question is :
using 'ethtool ' output I got a line : "Link detected : yes"
what does it means ?