LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to set up static IP/Broadband Router on CentOS to use Internet? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-set-up-static-ip-broadband-router-on-centos-to-use-internet-585059/)

linux_related 09-16-2007 07:40 AM

How to set up static IP/Broadband Router on CentOS to use Internet?
 
My configuration is simple.
ISP cable box -> Broadband Router (IP: 192.168.0.1) -> 2 PCs.
One PC is running Windows XP with DHCP -- no problem connecting to Internet. The other PC is CentOS 4.5 64-bit. On this box, if I configure DHCP, I can connect Internet easily but when trying to configure with Static IP -- it's not working (I just can ping to 192.168.0.1 but no traceroute or anything else). I tried all possile avenues & can't make it working. Can somebody please tell what I need to do set up this Static IP.
The IP address of my CentOS box I want is 194.170.3.104.
Thanks a lot.

MensaWater 09-16-2007 07:59 AM

To use the 194 address the router has to provide addresses in that range. By default most home routers provide 192 addresses instead which is why you see those when you do DHCP.

To use 194 you'd either have to configure the router itself to provide the 194 address OR have it simply be a pass through to the ISP who would then have to provide the 194 address.

P.S. A lot of folks do change their routers not to use 192 addresses if possible because since that is a known "default" hackers that find there way into your router can easily guess the addresses of attached PCs.

soroccoheaven 09-16-2007 08:27 AM

sorry...misunderstood the problem..

you are trying to put ip 194.170.3.104 ..? where ?..

linux_related 09-16-2007 09:01 AM

Some information about my system
 
Appliction -> System Setings -> Network ->
Network Configuration

Ethernet Device (for eth0)

Statically set IP addresses
Address: 194.170.3.104
Subnet mask: 255.255.255.0
Default gateway address: 192.168.0.1

Route (also tried without configuring it)

Destination network: 192.168.0.0 (also tried with 194.170.3.0)
Prefix (Netmask): 255.255.255.0
Gateway: 192.168.0.1


The file /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.0.255
HWADDR=00:0b:db:e7:1d:81
IPADDR=194.170.3.104
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=192.168.0.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes

The file /etc/network

NETWORKING=yes
HOSTNAME=linxdell

The file /etc/resolv.conf

nameserver 194.170.3.104
nameserver 127.0.0.1

THe file /etc/hosts

127.0.0.1 localhost.localdomain localhost
194.170.3.104 linxdell.systems.com linxdell linxdell

Output of route:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
194.170.3.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 et

Output of ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:0B:DB:E7:1D:81
inet addr:194.170.3.104 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20b:dbff:fee7:1d81/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:202 errors:0 dropped:0 overruns:0 frame:0
TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44368 (43.3 KiB) TX bytes:8476 (8.2 KiB)
Interrupt:11

Do I really need to change mu machin'es IP to 192.168.....?

Thanks a lot for all your help.

soroccoheaven 09-16-2007 09:15 AM

you can not use IP 194.170.3.104 with this 192.168.0.0 network which is configured in your router ..any reason behind why you are trying to put 194.170.3.104 to eth0 ?

soroccoheaven 09-16-2007 09:17 AM

else @jlightner
Quote:

To use the 194 address the router has to provide addresses in that range. By default most home routers provide 192 addresses instead which is why you see those when you do DHCP.
so configure your router accordingly.

linux_related 09-16-2007 10:20 AM

Changed IP address but still problem ....
 
I changed my machine's IP to 192.168.0.104, configured Network/Route -- recycled the box but still can't connect (I need Static IP -- not DHCP)! Any help will be highly appreciated.
Some latest information (if need more, I will provide).



Output of route:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
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


Output of traceroute 192.168.0.1:

traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 38 byte packets
1 192.168.0.1 (192.168.0.1) 1.444 msIcmp checksum is wrong
Icmp checksum is wrong
0.528 ms 0.498 ms

The file /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0b:db:e7:1d:81
IPADDR=192.168.0.104
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=192.168.0.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes

The file /etc/hosts:
127.0.0.1 localhost.localdomain localhost
192.168.0.104 linxdell.systems.com linxdell linxdell



THanks for your help.

soroccoheaven 09-16-2007 10:29 AM

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0b:db:e7:1d:81
IPADDR=192.168.0.104
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=192.168.0.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes

..make bootproto=static
and where is BROADCAST= ??
add BROADCAST=192.168.0.255
after editing dont forget to run command service network restart or /etc/init.d/network restart

linux_related 09-16-2007 10:43 AM

Still not working!!
 
Application -> System Setings -> Network ->
Network Configuration

Ethernet Device (for eth0)
Statically set IP address
Address: 192.168.0.104
Subnet mask: 255.255.255.0
Default gateway address: 192.168.0.1

Route

Destination network: 192.168.0.0
Prefix (Netmask): 255.255.255.0
Gateway: 192.168.0.1

The file /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.104
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
ONBOOT=yes
TYPE=Ethernet
GATEWAY=192.168.0.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes
HWADDR=00:0b:db:e7:1d:81


Output of ifconfig eth0:

eth0 Link encap:Ethernet HWaddr 00:0B:DB:E7:1D:81
inet addr:192.168.0.104 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20b:dbff:fee7:1d81/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:403 errors:0 dropped:0 overruns:0 frame:0
TX packets:835 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:227361 (222.0 KiB) TX bytes:105492 (103.0 KiB)
Interrupt:11

Output of traceroute 192.168.0.1:
traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 38 byte packets
1 linxdell (192.168.0.104) 3000.444 ms !H 192.168.0.1 (192.168.0.1) 1001.723 msIcmp checksum is wrong
Icmp checksum is wrong
0.530 ms



I sincerely appreciate all your responses. THanks.

soroccoheaven 09-16-2007 10:48 AM

try ping 192.168.0.1

linux_related 09-16-2007 10:53 AM

ping & traceroute
 
ping works fine but traceroute (both on 192.168.0.1) gives "Icmp checksum is wrong"
I am really baffled but appreciate your patience & help.

soroccoheaven 09-16-2007 10:56 AM

what about browsing ?

try traceroute -I 192.168.0.1 and post you ping and traceroute outputs

linux_related 09-16-2007 11:09 AM

ping & traceroute outputs (browsing doesn't work -- can't find the server)
 
ping 192.168.0.1

PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=0 ttl=255 time=0.493 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=255 time=0.486 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=255 time=0.484 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=255 time=0.480 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=255 time=0.486 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=255 time=0.480 ms

traceroute -I 192.168.0.1

traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 38 byte packets
1 192.168.0.1 (192.168.0.1) 0.517 msIcmp checksum is wrong
Icmp checksum is wrong
0.497 ms 0.422 ms

http://www.yahoo.com

Server not found
Firefox can't find the server at www.yahoo.com.

* Check the address for typing errors such as ww.example.com instead of www.example.com
* If you are unable to load any pages, check your computer's network connection.
* Ifputer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.


Note: All these problem are happening when trying to use STATIC IP. If I use DHCP, there is no problem but I want to use STATIC IP for several reasons. Thanks.

soroccoheaven 09-16-2007 11:16 AM

and what about traceroute linuxquestions.org

be sure to put nameserver ipof_your_dns in /etc/resolv.conf

I think is it is related with firewall disable it and see

jschiwal 09-16-2007 11:18 AM

You need to add your ISP's DNS addresses to /etc/resolv.

Another thing you can do is to configure your dhcp client to tell the server what IP address you should give your interface. The other values like /etc/resolve and the gateway address will be provided automatically then.


All times are GMT -5. The time now is 09:52 AM.