LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   CentOS DHCP to Static (https://www.linuxquestions.org/questions/linux-networking-3/centos-dhcp-to-static-680357/)

mitchell2345 10-31-2008 05:17 PM

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 * * *

custangro 10-31-2008 06:21 PM

Quote:

Originally Posted by mitchell2345 (Post 3327693)
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

mitchell2345 10-31-2008 09:57 PM

Quote:

Originally Posted by custangro (Post 3327722)
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

custangro 11-01-2008 12:30 AM

Quote:

Originally Posted by mitchell2345 (Post 3327853)
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

mitchell2345 11-01-2008 09:50 AM

Quote:

Originally Posted by custangro (Post 3327947)
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

custangro 11-01-2008 10:38 AM

Quote:

Originally Posted by mitchell2345 (Post 3328231)
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


All times are GMT -5. The time now is 04:29 PM.