Jump to content

Static IP


securitybreach

Recommended Posts

securitybreach

Ok I have setup a static IP before on this machine and now I cannot get it for some reason. To begin with I have a router with 4 client machines. The router shows:54678f33161049.gifHere is the /etc.rc.conf(archlinux config) revelant part:

eth0="eth0 192.168.10.120 netmask 255.255.255.0 broadcast 192.168.10.255"#eth0="dhcp"INTERFACES=(eth0)gateway="default gw 192.168.10.1"ROUTES=(gateway)

and here is my /etc/resolve.conf:

# Generated by dhcpcd from eth0# /etc/resolv.conf.head can replace this linesearch DarkStarnameserver 192.168.10.1# /etc/resolv.conf.tail can replace this line

Also, here is the route command after dhcpcd eth0:

[comhack@Venus ~]$ routeKernel IP routing tableDestination	 Gateway		 Genmask		 Flags Metric Ref	Use Iface192.168.10.0	*			   255.255.255.0   U	 0	  0		0 eth0default		 192.168.10.1	0.0.0.0		 UG	0	  0		0 eth0

I have searched, searched, and searched but cannot figure it out. With this configuration I can ping and open up the router but nothing else. I am having to dhcpcd eth0 to get any internet, Please help or atleast point me in the right direction. This is driving me crazy.Thanks

Edited by securitybreach
Link to comment
Share on other sites

I can not see anything wrong in the above . . . sorry.The /etc.rc.conf is typically Arch so hard for me to verify.B) Bruno

Link to comment
Share on other sites

Your routers address / gateway is at 192.168.10.1 ,correct?However, when I see:

$ routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.10.0 * 255.255.255.0 U 0 0 0 eth0default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
... I think (and I'm not familiar with Arch !) that's wrong, marked red. Correct me If I'm wrong, which very well could be so (just had my first coffee this morning).The starting address is 192.168.10.101, end address is 192.168.10.200. (screenshot) So you only can have an IP address within this range.I would try a change for the red markings above to say 192.168.10.1. It feels like some discrepancy in there...See if that works.
Link to comment
Share on other sites

securitybreach
Your routers address / gateway is at 192.168.10.1 ,correct?However, when I see:
$ routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.10.0 * 255.255.255.0 U 0 0 0 eth0default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
... I think (and I'm not familiar with Arch !) that's wrong, marked red. Correct me If I'm wrong, which very well could be so (just had my first coffee this morning).The starting address is 192.168.10.101, end address is 192.168.10.200. (screenshot) So you only can have an IP address within this range.I would try a change for the red markings above to say 192.168.10.1. It feels like some discrepancy in there...See if that works.
Yes my router is 192.168.10.1. How can I change this to 192.168.10.1 instead of 192.168.10.0?Thanks Edited by securitybreach
Link to comment
Share on other sites

Your routing table looks similar to mine...(I'm using static IP's as well with no problems)except mine also has an entry for loopback.routeDestination Gateway Genmask Flags Metric Ref Use Iface192.168.1.0 * 255.255.255.0 U 0 0 0 eth0loopback * 255.0.0.0 U 0 0 0 lodefault 192.168.1.1 0.0.0.0 UG 1 0 0 eth0I am confused about your screen shot though:It indicates both a static and dynamically assigned ip address of 192.168.10.120 for Venus.Is the MAC address the same for both?I would think that you could have only one or the other.Try releasing the dynamically assigned one (which is configured to never expire)and try with the statically assigned one again. HTHCheers

Link to comment
Share on other sites

securitybreach
Your routing table looks similar to mine...(I'm using static IP's as well with no problems)except mine also has an entry for loopback.routeDestination Gateway Genmask Flags Metric Ref Use Iface192.168.1.0 * 255.255.255.0 U 0 0 0 eth0loopback * 255.0.0.0 U 0 0 0 lodefault 192.168.1.1 0.0.0.0 UG 1 0 0 eth0I am confused about your screen shot though:It indicates both a static and dynamically assigned ip address of 192.168.10.120 for Venus.Is the MAC address the same for both?I would think that you could have only one or the other.Try releasing the dynamically assigned one (which is configured to never expire)and try with the statically assigned one again. HTHCheers
OK it is definetly a routing issue because I removed the dynamic Venus:957c3633208919.gifOnce again, I can access the router but not the internet.Thanks Edited by securitybreach
Link to comment
Share on other sites

... I think (and I'm not familiar with Arch !) that's wrong, marked red. Correct me If I'm wrong, which very well could be so (just had my first coffee this morning).The starting address is 192.168.10.101, end address is 192.168.10.200. (screenshot) So you only can have an IP address within this range.I would try a change for the red markings above to say 192.168.10.1. It feels like some discrepancy in there...See if that works.Yes my router is 192.168.10.1. How can I change this to 192.168.10.1 instead of 192.168.10.0?Thanks
Use a terminal to run:
#cat /etc/resolv.conf

This should tell you what the DNS server address it set to. If it is not 192.168.10.1 then this is your problem. Try typing the address 74.125.65.104 in your browser. This is google address. If it brings up google's page, your gateway is correct but your DNS server address isn't.

Link to comment
Share on other sites

securitybreach

Ok I can ping that address but no net....

[comhack@Venus ~]$ ping 74.125.65.104PING 74.125.65.104 (74.125.65.104) 56(84) bytes of data.64 bytes from 74.125.65.104: icmp_seq=1 ttl=245 time=34.6 ms64 bytes from 74.125.65.104: icmp_seq=2 ttl=245 time=33.1 ms64 bytes from 74.125.65.104: icmp_seq=3 ttl=245 time=29.8 ms64 bytes from 74.125.65.104: icmp_seq=4 ttl=245 time=30.5 ms64 bytes from 74.125.65.104: icmp_seq=5 ttl=245 time=31.9 ms64 bytes from 74.125.65.104: icmp_seq=6 ttl=245 time=30.8 ms64 bytes from 74.125.65.104: icmp_seq=7 ttl=245 time=30.2 ms64 bytes from 74.125.65.104: icmp_seq=8 ttl=245 time=31.1 ms^C--- 74.125.65.104 ping statistics ---8 packets transmitted, 8 received, 0% packet loss, time 7010msrtt min/avg/max/mdev = 29.817/31.538/34.639/1.543 ms

Looks like we're getting closer.Here is cat /etc/resolve.conf with dhcpcd:

bash-3.2# cat /etc/resolv.conf # Generated by dhcpcd from eth0# /etc/resolv.conf.head can replace this linesearch DarkStarnameserver 192.168.10.1# /etc/resolv.conf.tail can replace this line

and without:

bash-3.2# cat /etc/resolv.conf # Generated by dhcpcd# /etc/resolv.conf.head can replace this line# /etc/resolv.conf.tail can replace this line

Thanks

Edited by securitybreach
Link to comment
Share on other sites

Use a terminal to run:
#cat /etc/resolv.conf

This should tell you what the DNS server address it set to. If it is not 192.168.10.1 then this is your problem. Try typing the address 74.125.65.104 in your browser. This is google address. If it brings up google's page, your gateway is correct but your DNS server address isn't.

I was thinking the name server as well...since he could only ping the router and that he could get online after doing a dhcpd.He did list his resolve.conf but that probably gets changed after the dhcpd.Hopefully that will be the fix...if not I did come across a page which mentioned:When using both static and dynamic addresses on the lan (the static ip's should be outside the range of the dynamically assigned ones)Static and Dynamic IP Address Q & A
Link to comment
Share on other sites

securitybreach
I was thinking the name server as well...since he could only ping the router and that he could get online after doing a dhcpd.He did list his resolve.conf but that probably gets changed after the dhcpd.Hopefully that will be the fix...if not I did come across a page which mentioned:When using both static and dynamic addresses on the lan (the static ip's should be outside the range of the dynamically assigned ones)Static and Dynamic IP Address Q & A
Well I just added the dhcpcd resolve.conf info to the statice resolve.conf and it worked. Someone else suggested to use outside of the range but my router gave an error about outside the range when I changed the static to 192.168.10.201.I do not know if this was the correct method but it worked.Thanks Edited by securitybreach
Link to comment
Share on other sites

I was thinking the name server as well...since he could only ping the router and that he could get online after doing a dhcpd.He did list his resolve.conf but that probably gets changed after the dhcpd.Hopefully that will be the fix...if not I did come across a page which mentioned:When using both static and dynamic addresses on the lan (the static ip's should be outside the range of the dynamically assigned ones)Static and Dynamic IP Address Q & A
Yes. dhcpd will overwrite the /etc/resolv.conf file. That's why I didn't tell him to edit it. But what happens when he boots the next time? Is the nameserver address wrong again?I'm not familiar with Arch Linux, so I don't know if something in the boot process is also modifying the file. If you are using static address, then editing that file to the correct server address, should fix the problem. But not if something else is modifying during the boot process.Yes, the static IP you choose should be outside the address range the router is using for DHCP. Edited by lewmur
Link to comment
Share on other sites

securitybreach
Yes. dhcpd will overwrite the /etc/resolv.conf file. That's why I didn't tell him to edit it. But what happens when he boots the next time? Is the nameserver address wrong again?I'm not familiar with Arch Linux, so I don't know if something in the boot process is also modifying the file. If you are using static address, then editing that file to the correct server address, should fix the problem. But not if something else is modifying during the boot process.
Nope I rebooted and it stayed. Archlinux uses a conf file for inits. Here is mine:http://pastebin.com/f49118e67Pretty self-explanatory.Thanks Edited by securitybreach
Link to comment
Share on other sites

Yes. dhcpd will overwrite the /etc/resolv.conf file. That's why I didn't tell him to edit it. But what happens when he boots the next time? Is the nameserver address wrong again?I'm not familiar with Arch Linux, so I don't know if something in the boot process is also modifying the file. If you are using static address, then editing that file to the correct server address, should fix the problem. But not if something else is modifying during the boot process.
ditto...but you beat me to the punch...I was just going to ask...what resolve.conf looked like after a fresh reboot. B)
Link to comment
Share on other sites

securitybreach

After reboot:

bash-3.2# cat /etc/resolv.conf # Generated by dhcpcd# /etc/resolv.conf.head can replace this linesearch DarkStarnameserver 192.168.10.1# /etc/resolv.conf.tail can replace this line

Thanks for all the help

Edited by securitybreach
Link to comment
Share on other sites

Glad the problem is solved . . . . . but isn't that the exact same /etc/resolv.conf you had in your first post ?B) Bruno

Link to comment
Share on other sites

securitybreach

Yes but that was generated by dhcpcd. If dhcpcd was not started the file was empty. So I added the dhcpcd entry in the empty "static" one.Thanks

Edited by securitybreach
Link to comment
Share on other sites

V.T. Eric Layton

Hey securitybreach,Just for future reference, you can ping with a finite number of pings using the -c modifier. Like this:

vtel57@ericsbane03:~$ ping -c2 www.scotsnewsletter.comPING www.scotsnewsletter.com (74.63.43.176) 56(84) bytes of data.64 bytes from 74.63.43.176: icmp_seq=1 ttl=51 time=61.8 ms64 bytes from 74.63.43.176: icmp_seq=2 ttl=51 time=61.8 ms--- www.scotsnewsletter.com ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1004msrtt min/avg/max/mdev = 61.807/61.827/61.848/0.249 ms

The number after the "c" is the amount of pings you want to send out. Have fun! :)

Link to comment
Share on other sites

securitybreach

Thanks I knew that but was not thinking at the time. Was a little frustrated..... :) Thanks for the useful information though.

Edited by securitybreach
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...