static vs dynamic ip

Hi exps,
I have a redhat linux gateway which works as gateway,dns,dhcp and firewall for my lan.
It has two nic, one wiht outgoing static ip and one internal connected with static ip. since last few days, internal one goes on dynamic ip. this create problem, my destops stop connecting to internet. this is happening since last few weeks and with regular interwals of few days. To resolve this i have to assign internal nic with static same ip again and reastart netwerok service and named from /etc/init.d.
Pleaset help to resolve this issue.
Best Regards,
cheers
pappu
LVL 2
vxlilAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
DarthModConnect With a Mentor Commented:
PAQed with points (125) refunded

DarthMod
Community Support Moderator
0
 
PowerToasterCommented:
When you say it changes to DHCP, How are checking this? What version of Redhat? Does it get an IP when it is dhcp mode or does it default to an autoconfig?
0
 
blklineCommented:
What is the contents of the following files:

/etc/sysconfig/network-scripts/ifcfg-eth0 & 

/etc/sysconfig/network-scripts/ifcfg-eth1
0
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
vxlilAuthor Commented:
Hi Blkline,
Please have look at the contents of

eth0 :

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.133.239
NETMASK=255.255.255.128
GATEWAY=192.168.133.239


eth1 :

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.49.74
NETMASK=255.255.255.252
GATEWAY=192.168.49.73


pappu


0
 
LuxanaCommented:
>internal one goes on dynamic ip. this create problem, my destops stop connecting to internet

did you get dns setting on your desktop from your dhcp?

have a look to /etc/resolv.conf for nameserves and make sure that you are have thet address for name servaer and also if your setting for networkard have a proper gateway ip address
0
 
vxlilAuthor Commented:
Hi Luxana,
Yes all my desktop are getting all settings and ips and everything from dhcp.... including dns.

cheers..
pappu
0
 
LuxanaCommented:
ok so I thing is time to give us more info..

why did you setup internal nic to dynamic IP? Or it happends by it self? And why the setting you show us is saying the both nic's are static? What is your desktop nic setting? how you are sharing internet? proxy? masqurade? :-)

0
 
vxlilAuthor Commented:
Hi Luxana,
Both nics of gateway are static.... all ip of desktop are dynamic from dhcp..... gateway is dhcp... and  dns..... but once in a week inter nic goes on to dynamic.... it simple... then i hve to bring it back to static once agin...

Cheers..
pappu
0
 
PowerToasterCommented:
When it goes DHCP does it always get the same dynamic IP?
0
 
LuxanaCommented:
you said that it is happenig regulary ! do you know the time? did you check logs such as /var/log/syslog or /var/log/messages and compare it with time when it is happennig? Are you runnig some scripts using cron?
0
 
vxlilAuthor Commented:
yes PowerToaster..... it does get same ip... :)


Cheers...
Pappu
0
 
vxlilAuthor Commented:
Hi guys,
I am not able to find the /var/log/syslog... but could /var/log/messages.... which is also useles....
waiting for your guideance buddies...

cheers...

pappu...
0
 
PowerToasterCommented:
try this command.

cat /var/log/messages | grep xxx.xxx.xx.xx

replace the xx's with the ip address your machine gets, depending on how often your logrotater changes the logs you might also need to check messages.1 or .2.

If you find something that matches it will probably be the aquisition of the DHCP address and knowing what is happening at about the same time as the change would be helpful.
0
 
vxlilAuthor Commented:
Internal NIC :

ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0B:CD:F2:06:FD
          inet addr:192.168.133.239  Bcast:192.168.133.255  Mask:255.255.255.128
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:412326787 errors:0 dropped:0 overruns:0 frame:0
          TX packets:403018284 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:199892366 (190.6 Mb)  TX bytes:236592592 (225.6 Mb)
          Interrupt:29


Many Many entries in /var/log/message.2 :

Sep 15 04:00:36 gateway dhcpd: DHCPREQUEST for 192.168.133.162 from 00:0b:cd:f2:06:fd via eth0
Sep 15 04:00:36 gateway dhcpd: DHCPACK on 192.168.133.162 to 00:0b:cd:f2:06:fd via eth0


Sep 15 16:18:50 gateway dhcpd: DHCPREQUEST for 192.168.133.162 (192.168.133.239) from 00:0b:cd:f2:06:fd via eth0
Sep 15 16:18:50 gateway dhcpd: DHCPACK on 192.168.133.162 to 00:0b:cd:f2:06:fd via eth0
Sep 15 16:18:50 gateway dhclient: bound to 192.168.133.162 -- renewal in 217146 seconds.
Sep 15 16:34:02 gateway named[24184]: listening on IPv4 interface eth0, 192.168.133.162#53


Sep 18 19:10:34 gateway kernel: IN=eth1 OUT=eth0 SRC=192.168.122.250 DST=192.168.133.162 LEN=44 TOS=0x00 PREC=0x00 TTL=120 ID=31067 DF PROTO=TCP SPT=2506 DPT=139 WINDOW=8192 RES=0x00 SYN URGP=0
Sep 18 19:10:48 gateway kernel: IN=eth1 OUT=eth0 SRC=192.168.122.250 DST=192.168.133.162 LEN=44 TOS=0x00 PREC=0x00 TTL=120 ID=7262 DF PROTO=TCP SPT=2506 DPT=139 WINDOW=8192 RES=0x00 SYN URGP=0

Many Many entries in /var/log/message:

Oct  1 18:57:37 gateway kernel: IN=eth1 OUT=eth0 SRC=192.168.51.125 DST=192.168.133.162 LEN=44 TOS=0x00 PREC=0x00 TTL=114 ID=27076 DF PROTO=TCP SPT=1222 DPT=139 WINDOW=8192 RES=0x00 SYN URGP=0


N.B. Services viz., DNS and DHCP is also running on this machine.


cheers...
pappu
0
 
LuxanaCommented:
you should at least know what time it always happening...

paste here
/etc/crontab
0
 
vxlilAuthor Commented:
Hi Luxana,
this is here....

-----------------------------------
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
~
------------------------


cheers..
pappu
0
 
LuxanaCommented:
vxlil,

so what about the time ? You seaid that it is happening regulary, what time and when? also you did not answer my questions above if you are runinig some scrips wiith user cron?

This seems to me like you are palying some game. Answer questoin and use common sense to figeret out what can reguraly change your IP's..
0
 
vxlilAuthor Commented:
its happening every week....
regularly.....

pappu..
0
 
LuxanaCommented:
what time ?...which day...? why you are not asnwering questions? is this a game?
0
 
vxlilAuthor Commented:
I applogize Luxana, i do  not remember the exact time... let me see time.. it was on 15 sept'04 around 5 PM.. then it again happnd two more time... but i don't have any recorded timings...

pappu
0
 
LuxanaCommented:
everything is recorded in /var/log
time is important when it happen again check time save your current logs go through them ad look for something supicious with looking for time when it happened.
0
 
vxlilAuthor Commented:
Hi Luxana,
let me tell you this started... once I was just going through the dhcp configuration file...
I did executed one script... I do not remember the exact name of that script file... suddenly my internal NIC got the ip from dhcp. Since that time I am facing this issue.
What I feel, this is the same file.. which decides the lease time for desktops... but i don't know how to stop this happning.. and i would like to keep my internal NIC on static ip only...

N.B.:max-lease-time 604800

BR,
pappu
0
 
LuxanaCommented:
we need to know more about that script ...what was the reason you run it ? paste here configureations files for your network card and also /etc/dhcpd.conf

when you run

# crontab -e
are there some entries? this command opens you root cron file.
0
 
vxlilAuthor Commented:
Hi Lunxana,
/etc/dhcpd.conf


-----------------------------------------------------------------------
default-lease-time 518400;
max-lease-time 604800;
ddns-update-style none;
option subnet-mask 255.255.255.128;
option broadcast-address 192.168.133.255;
option domain-name "etech";
option domain-name-servers 192.168.133.239;
#option domain-name-servers 192.168.135.249;
#option domain-name-servers 192.168.135.254;
option routers 192.168.133.239;
option netbios-name-servers 192.168.51.250;

subnet 192.168.133.0 netmask 255.255.255.0 {
#        authoritative;
        range 192.168.133.129 192.168.133.199;
}

----------------------------------------------------------------------------------

crontab -e is showing blank file....

pappu
0
 
LuxanaCommented:
only you have root password and priviligies?

15 sept'04 was wednesday.. when it will happend again remeber exact time day and make backup of your /var/log/

we need to know more about that script ...what was the reason you run it ? paste here configureations files for your network card
0
 
vxlilAuthor Commented:
Hae Luxana,
Issues very stupid, my server was running dhcp client, it was taking ip from the dhcp server.

issue resolved...

cheers!

-vx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.