LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 10-31-2008, 05:17 PM   #1
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Rep: Reputation: 16
CentOS DHCP to Static


I just moved my DHCP server from my router to my CentOS Linux server. I have also replaced the Linux firewall with a ASA. So i need to set the linux box with a static IP.

What is working:
DHCPd is working, server IP's to LAN clients.
On the server I can hit LAN equip.
DHCP clients can hit the internet

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
Physical Address. . . . . . . . . : 00-16-41-59-46-C5
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.149
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.202
DNS Servers . . . . . . . . . . . : 76.85.229.110
Lease Obtained. . . . . . . . . . : Friday, October 31, 2008 2:48:45 PM
Lease Expires . . . . . . . . . . : Saturday, November 01, 2008 2:48:45PM

What is not:
accessing the internet

Some details:
[root@mythtv ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.84.0 * 255.255.255.0 U 0 0 0 vmnet8
172.16.49.0 * 255.255.255.0 U 0 0 0 vmnet1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

[root@mythtv ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mythtv
GATEWAY=192.168.0.1

[root@mythtv ~]# cat /etc/resolv.conf
nameserver 75.85.229.110
nameserver 75.85.229.111

[root@mythtv ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# nVidia Corporation MCP51 Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:1D:60:E5:FC:BB
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.202
GATEWAY=192.168.0.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

[root@mythtv ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1D:60:E5:FC:BB
inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::21d:60ff:fee5:fcbb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30787 errors:0 dropped:0 overruns:0 frame:0
TX packets:55503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2943836 (2.8 MiB) TX bytes:10082363 (9.6 MiB)
Interrupt:177 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9935 errors:0 dropped:0 overruns:0 frame:0
TX packets:9935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7514266 (7.1 MiB) TX bytes:7514266 (7.1 MiB)

vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01
inet addr:172.16.49.1 Bcast:172.16.49.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
inet addr:192.168.84.1 Bcast:192.168.84.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


I can ping the gateway of 192.168.0.1 but if i trace to 4.2.2.2 it times out. This leads me to believe its a routing issue. I have the gateway set and the route apears to show up. What is it not working?



I couldnt traceroute becuase my ASA was blocking it. Now i can trace from DHCP clients.

still not from the server tho:

[root@mythtv plugins]# tracert 72.14.207.99
traceroute to 72.14.207.99 (72.14.207.99), 30 hops max, 40 byte packets
1 (76.43.168.1) 5.759 ms 9.566 ms *
2 * * *
3 * * *
4 * * *

also DNS doesnt work:
[root@mythtv plugins]# tracert 72.14.207.99
traceroute to 72.14.207.99 (72.14.207.99), 30 hops max, 40 byte packets
1 (76.43.168.1) 5.759 ms 9.566 ms *
2 * * *
3 * * *
4 * * *
 
Old 10-31-2008, 06:21 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by mitchell2345 View Post
I just moved my DHCP server from my router to my CentOS Linux server. I have also replaced the Linux firewall with a ASA. So i need to set the linux box with a static IP.

What is working:
DHCPd is working, server IP's to LAN clients.
On the server I can hit LAN equip.
DHCP clients can hit the internet

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
Physical Address. . . . . . . . . : 00-16-41-59-46-C5
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.149
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.202
DNS Servers . . . . . . . . . . . : 76.85.229.110
Lease Obtained. . . . . . . . . . : Friday, October 31, 2008 2:48:45 PM
Lease Expires . . . . . . . . . . : Saturday, November 01, 2008 2:48:45PM

What is not:
accessing the internet

Some details:
[root@mythtv ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.84.0 * 255.255.255.0 U 0 0 0 vmnet8
172.16.49.0 * 255.255.255.0 U 0 0 0 vmnet1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

[root@mythtv ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mythtv
GATEWAY=192.168.0.1

[root@mythtv ~]# cat /etc/resolv.conf
nameserver 75.85.229.110
nameserver 75.85.229.111

[root@mythtv ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# nVidia Corporation MCP51 Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:1D:60:E5:FC:BB
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.202
GATEWAY=192.168.0.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

[root@mythtv ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1D:60:E5:FC:BB
inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::21d:60ff:fee5:fcbb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30787 errors:0 dropped:0 overruns:0 frame:0
TX packets:55503 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2943836 (2.8 MiB) TX bytes:10082363 (9.6 MiB)
Interrupt:177 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9935 errors:0 dropped:0 overruns:0 frame:0
TX packets:9935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7514266 (7.1 MiB) TX bytes:7514266 (7.1 MiB)

vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01
inet addr:172.16.49.1 Bcast:172.16.49.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
inet addr:192.168.84.1 Bcast:192.168.84.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


I can ping the gateway of 192.168.0.1 but if i trace to 4.2.2.2 it times out. This leads me to believe its a routing issue. I have the gateway set and the route apears to show up. What is it not working?



I couldnt traceroute becuase my ASA was blocking it. Now i can trace from DHCP clients.

still not from the server tho:

[root@mythtv plugins]# tracert 72.14.207.99
traceroute to 72.14.207.99 (72.14.207.99), 30 hops max, 40 byte packets
1 (76.43.168.1) 5.759 ms 9.566 ms *
2 * * *
3 * * *
4 * * *

also DNS doesnt work:
[root@mythtv plugins]# tracert 72.14.207.99
traceroute to 72.14.207.99 (72.14.207.99), 30 hops max, 40 byte packets
1 (76.43.168.1) 5.759 ms 9.566 ms *
2 * * *
3 * * *
4 * * *
On the ASA do a

Code:
show interface ip bri
and

Code:
show route
Let's take look at those configs...maybe a show run too?

-C
 
Old 10-31-2008, 09:57 PM   #3
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by custangro View Post
On the ASA do a

Code:
show interface ip bri
and

Code:
show route
Let's take look at those configs...maybe a show run too?

-C
the asa has to be right as my dhcp clients are working. but since im stumped here you go:

ASA# sho route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is 65.28.16.1 to network 0.0.0.0

C XX.XX.16.0 255.255.254.0 is directly connected, outside
C 127.1.0.0 255.255.0.0 is directly connected, _internal_loopback
C 192.168.0.0 255.255.255.0 is directly connected, inside
d* 0.0.0.0 0.0.0.0 [1/0] via 65.28.16.1, outside

ASA# sho int ip bri
Interface IP-Address OK? Method Status Protocol
Internal-Data0/0 unassigned YES unset up up
Internal-Data0/1 unassigned YES unset administratively down up
Loopback0 127.1.0.1 YES unset up up
Vlan1 192.168.0.1 YES CONFIG up up
Vlan2 XX.XX.17.29 YES DHCP up up
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
Ethernet0/4 unassigned YES unset down down
Ethernet0/5 unassigned YES unset down down
Ethernet0/6 unassigned YES unset down down
Ethernet0/7 unassigned YES unset down down

although really slow, traceroute does work:
[root@mythtv ~]# traceroute 4.2.2.2
traceroute to 4.2.2.2 (4.2.2.2), 30 hops max, 40 byte packets
1 (76.43.168.1) 7.807 ms 10.615 ms 15.870 ms
2 (24.31.234.230) 16.500 ms 16.479 ms 16.439 ms
3 (69.76.62.253) 27.741 ms 37.460 ms 38.308 ms
4 (24.31.235.37) 28.272 ms (24.31.235.33) 27.213 ms 27.272 ms
5 (4.71.248.13) 31.750 ms 32.124 ms (4.71.248.1) 51.611 ms
6 (4.69.138.158) 31.627 ms 19.252 ms 18.941 ms
7 (4.69.140.189) 30.258 ms 30.226 ms 30.199 ms
8 (4.68.101.34) 27.933 ms (4.68.101.2) 28.097 ms (4.68.101.162) 29.128 ms
9 (4.2.2.2) 29.053 ms 29.013 ms 20.101 ms

Last edited by mitchell2345; 10-31-2008 at 10:06 PM.
 
Old 11-01-2008, 12:30 AM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by mitchell2345 View Post
although really slow, traceroute does work:
[root@mythtv ~]# traceroute 4.2.2.2
traceroute to 4.2.2.2 (4.2.2.2), 30 hops max, 40 byte packets
1 (76.43.168.1) 7.807 ms 10.615 ms 15.870 ms
2 (24.31.234.230) 16.500 ms 16.479 ms 16.439 ms
3 (69.76.62.253) 27.741 ms 37.460 ms 38.308 ms
4 (24.31.235.37) 28.272 ms (24.31.235.33) 27.213 ms 27.272 ms
5 (4.71.248.13) 31.750 ms 32.124 ms (4.71.248.1) 51.611 ms
6 (4.69.138.158) 31.627 ms 19.252 ms 18.941 ms
7 (4.69.140.189) 30.258 ms 30.226 ms 30.199 ms
8 (4.68.101.34) 27.933 ms (4.68.101.2) 28.097 ms (4.68.101.162) 29.128 ms
9 (4.2.2.2) 29.053 ms 29.013 ms 20.101 ms
Interesting that traceroute works...but not ping...because they both use ICMP....I need to think on this one....

What type of communications are you trying to do? http? cifs?

-C
 
Old 11-01-2008, 09:50 AM   #5
mitchell2345
Member
 
Registered: Aug 2008
Posts: 55

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by custangro View Post
Interesting that traceroute works...but not ping...because they both use ICMP....I need to think on this one....

What type of communications are you trying to do? http? cifs?

-C
Well, I was able to finally get it to work. I dont understand why this works as the routing table was correct BUT.

In the system-config-network box where i edited the IP i had to goto the route tab and put in

0.0.0.0 0.0.0.0 192.168.0.1

Mitchell
 
Old 11-01-2008, 10:38 AM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by mitchell2345 View Post
Well, I was able to finally get it to work. I dont understand why this works as the routing table was correct BUT.

In the system-config-network box where i edited the IP i had to goto the route tab and put in

0.0.0.0 0.0.0.0 192.168.0.1

Mitchell
I see...

Thanks for posting the solution!

-C
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up static IP/Broadband Router on CentOS to use Internet? linux_related Linux - Networking 23 09-19-2007 01:01 AM
Using DHCP with a static IP ninmonkeys Linux - Networking 9 11-30-2004 07:32 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
DHCP to static IP ?? davepal Linux - Networking 1 04-21-2004 09:34 AM
DHCP or Static Culbert Linux - Networking 1 03-14-2003 07:42 PM


All times are GMT -5. The time now is 12:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration