Link to home
Start Free TrialLog in
Avatar of ora-what
ora-what

asked on

assign static ip to enterprise linux through d-link router isp gives dhcp ip address

Hi,

I have a home network of 2 PC connected to a D-Link DI-604 Router.

So you get the picture, the router has a WAN port and 4 LAN ports.

PC #1 is physically attached to LAN port #1
PC #2 is physically attached to LAN port #2

My DSL modem is physically attached to the WAN port.

The router provides internet for both machines.

PC #1 is running Oracle Enterprise Linux and I need to assign a static ip address
PC#2 is running a windows os

I am able to ping over the network from windows to linux as I'm testing the linux ip address.

The problem is whenever the linux machine reboots it gets assigned a new ip address. I can see the ip address
appear in my router configuration through its web browser interface on the windows machine PC#2.

I have tried assigning a static ip through the router and there is that means to do it but it doesn't stay.
 
Avatar of John
John
Flag of Canada image

Pull up the router configuration web page for the D-LINK router and see where it assigns DHCP (probably 192.168.x.100 through 150 or 199 or such like). Reconfigure DHCP addressing to something here (e.g. start it at 200). Restart the router. Then configure your PC's for static addresses starting at 100. You can start them anywhere really, I am just giving some ideas for relocating DHCP to have it out of the way. You can also disable it, but you might want it some day. ... Thinkpads_User
SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ora-what
ora-what

ASKER

ok i made that change,

in my router's home page I'm in home-dhcp

this is what is says in the router web page

"DHCP Server
The DI-604 can be setup as a DHCP Server to distribute IP addresses to the LAN network."

here I set the range to 192.168.0.200 - 250

"Static DHCP
Static DHCP is used to allow DHCP server to assign same IP address to specific MAC address"

here I am able to clone the MAC address of an ip address that appears in the Dynamic IP Client list (below)
and it then appears in the Static Client IP Address (below)

"Static DHCP Client List"

this list is currently empty

"Dynamic DHCP Client List
Host Name       IP Address       MAC Address       Expired Time       
      192.168.0.200      00-00-6c-f0-4d-fc      Apr/08/2002 03:01:40"

this .200 ip address appeared after I restarted the linux machine PC#1
it's the only client in the list

I restarted the router.


I restarted PC#1 (the linux machine) and when it starts it shows that

my eth0 interface has ip address 192.168.0.200 (as shown in the router Dynamic DHCP Client list)


in linux now I want to give this machine a static ip

so I vi /etc/sysconfig/network-scripts/icfg-eth0

I get

#nVidia Corporation MCP61 Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:00:6c:f0:4d:fc


should I change this file?
if so, how should I change it considering my router?




oh I just saw your comment KeremE I will try that...

Hi,

I did what you suggested,

I did:

ifconfig eth0 | head -1
I got the MAC address. It was the same address that was shown in the Dynamic DHCP Client List in the router web page for 192.168.0.200.

So under Static DHCP I gave it a name Oracle EL and entered the MAC address I got from the linux machine.
I gave it ip address 192.168.0.122 (to be out of the way of the 200 - 250 range that it now provides).
I clicked apply and I notced the the listing for 192.168.0.200 under Dynamic DHCP Clients List disappeared.

I rebooted the linux machine and it gave me ip address 192.168.0.200.

So, the static ip specified in the router doesn't seem to be working.

I think I also need to give the linux machine a static ip to match.

Could anyone help me do that?

Oracle Enterprise Linux is just some rebranded RedHat Enterprise Linux. So you need to modify here to make your change permanent:

/etc/sysconfig/networking/profiles/default/ifcfg-eth0

- Locate BOOTPROTO=  modify it  to read "none"
- Locate the IPADDR= modify it to reflect your proposed IP address.
- Modify NETMASK= if you need. If you want to assign a Default Gateway you need to modify :
- Locate GATEWAY= and modify itto reflect your DG.

Save & exit
I also noticed that the linux machine was ALSO assigned a different MAC address
ok I see,

well my /etc/sysconfig/networking/profiles/default/ifcfg-eth0 directory is empty

do i need to create the file?
Modify it to look like this:

TYPE=Ethernet
DEVICE=eth0
HWADDR=00:00:6c:f0:4d:fc
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.0.122
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=no
GATEWAY=192.168.0.1
no you can use the one you've discovered yourself.
So you can go either with this MAC or you can change the IP in the file.
Forget my note id {24836524}. Just do it this way. I've forgotten your Oracle Enterprise Linux is RedHat 4.x

#nVidia Corporation MCP61 Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
HWADDR=00:00:6c:f0:4d:fc
NETMASK=255.255.255.0
IPADDR=192.168.0.122
GATEWAY=192.168.0.1
BOOTPROTO=static

is better for your version I guess..
ok I changed the file to this in /etc/sysconfig/network-scripts/ifcfg-eth0

TYPE=Ethernet
DEVICE=eth0
HWADDR=00:00:6c:f0:4d:fc
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.0.122
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=no
GATEWAY=192.168.0.1

then I rebooted the machine

i saw at start that I was assigned ip address 192.168.0.201
with mac address 00-00-6c-5f-22-43


#nVidia Corporation MCP61 Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:00:6c:5f:22:43


so the changes I made do not stay

in my router there are now 2 entries under

Dynamic DHCP Client List
Host Name       IP Address       MAC Address       Expired Time       
      192.168.0.201      00-00-6c-5f-22-43      Apr/08/2002 03:41:36
      192.168.0.200      00-00-6c-3a-66-11      Apr/08/2002 03:16:50

and the same static entry is still there

Static DHCP Client List
        Host Name       IP Address       MAC Address       
      Oracle VM Server      192.168.0.122      00-00-6c-f0-4d-fc


they keep changing..
I guess this is not an issue with Oracle Enterprise but it is a problem with VMWare. Please check this here:

http://www.vmware.com/support/ws55/doc/ws_net_advanced_mac_address.html

Is the Oracle machine a Viirtual Machine? If so, put it in Bridge mode (you have a router) and then VMware will not interfere with the Oracle VM with respect to DHCP. ... Thinkpads_User
it's not vware

it's a product called Oracle VM Server

you can download it for free

it's really a minimal version of Oracle Enterprise Server

it's not VMware sorry
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The document server says the file is named vm.cfg
yes the release is this:

2.6.18-8.1.15.3.1.el5xen


I will let know what happens very soon.....
Ok take your time.

This is a known problem with XEN. But I'd never met one because I always assign a MAC address to my virtual interfaces during installation cus I'd always though that this would be a potential pitfall.

Oracle has its Enterprise Linux but it does not develop its own Linux distro. They re simply re-branding Red Hat Enterprise. It seems that they are actually repacking Xen enabled kernel over Red-Hat enterprise as a different product.

Why don't you go for CentOS it is directly built from RHEL sources and rebranded. It is free. You can find lots of documentation on implementing. XEN clients.

The community does not like Re-branded and priced software as it is often means stipulations on source code availability and modification polices. I'll suggest you to go with the Open source and well documented Xen host such as CentOS. Or if you want to be on the safe side you can directly go for Red Hat Enterprise instead.

Cheers,
K.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial