static IP configuration problem

Greg Rundlett greg.rundlett at gmail.com
Thu Sep 22 23:42:00 EDT 2005


recap: DHCP will work, but I can't assign a static IP address to my machine,
unless I do a DHCP setup first, then do a static, and restart the network
interface, but do not reboot the machine b/c the interface configuration
fails to work after a OS reboot(if left as static).



On 9/13/05, Benjamin Scott <dragonhawk at iname.com> wrote:
>
> On Sep 13 at 7:55am, Randy Edwards wrote:
> > Then do a "ifdown ethX ; ifconfig ethX down".
>
> Even better is:
>
> ifconfig ethX 0.0.0.0 <http://0.0.0.0> down


did that,
and prior to that I also did netstat -rn to see that the gateway was set
correctly

ifconfig eth0 192.168.1.111 <http://192.168.1.111> netmask
255.255.255.0<http://255.255.255.0>broadcast
192.168.1.255 <http://192.168.1.255> up

did not complain, but also did not result in a working interface (that could
get to the internet). Apparently the interface is working, b/c I can ping
other hosts on the network, I just can't get out onto the web.

--- 192.168.1.15 <http://192.168.1.15> ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.529/0.631/0.921/0.169 ms


liberty:/# /etc/init.d/networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...SIOCDELRT: No such process
ifup: interface lo already configured
done.

NOTICE HOW THERE IS NO OUTPUT HERE RELATED TO ETH0....WHEREAS WHEN I RESTART
WITH DHCP, IT DOES


Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...ifup: interface lo already configured
Internet Software Consortium DHCP Client 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Listening on LPF/eth0/00:50:2c:02:a7:d8
Sending on LPF/eth0/00:50:2c:02:a7:d8
Sending on Socket/fallback/fallback-net
DHCPREQUEST on eth0 to 255.255.255.255 <http://255.255.255.255> port 67
DHCPACK from 192.168.1.15 <http://192.168.1.15>
bound to 192.168.1.125 <http://192.168.1.125> -- renewal in 43200 seconds.
done.


liberty:/# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:2C:02:A7:D8
inet addr:192.168.1.111 <http://192.168.1.111>
Bcast:192.168.1.255<http://192.168.1.255>Mask:
255.255.255.0 <http://255.255.255.0>
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:239473 errors:0 dropped:0 overruns:0 frame:0
TX packets:105287 errors:0 dropped:0 overruns:0 carrier:0
collisions:29722
RX bytes:240897141 (229.7 MiB) TX bytes:10702634 (10.2 MiB)




MORE INFO ABOUT A CLEAN REBOOT



Upon booting (can't get out onto the WWW), but can ping local network
addresses, including the router/gateway device 192.168.1.15<http://192.168.1.15>


greg at liberty:~$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 <http://192.168.1.0> * 255.255.255.0 <http://255.255.255.0> U 0
0 0 eth0
default 192.168.1.15 <http://192.168.1.15> 0.0.0.0 <http://0.0.0.0> UG 0 0 0
eth0

liberty:/home/greg# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 <http://192.168.1.0> 0.0.0.0 <http://0.0.0.0>
255.255.255.0<http://255.255.255.0>U 0 0 0 eth0
0.0.0.0 <http://0.0.0.0> 192.168.1.15 <http://192.168.1.15>
0.0.0.0<http://0.0.0.0>UG 0 0 0 eth0


greg at liberty:~$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:2C:02:A7:D8
inet addr:192.168.1.111 <http://192.168.1.111>
Bcast:192.168.1.255<http://192.168.1.255>Mask:
255.255.255.0 <http://255.255.255.0>
EtherTalk Phase 2 addr:65280/218
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:583 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:43502 (42.4 KiB) TX bytes:1705 (1.6 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 <http://127.0.0.1> Mask:255.0.0.0 <http://255.0.0.0>
EtherTalk Phase 2 addr:0/0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:568 errors:0 dropped:0 overruns:0 frame:0
TX packets:568 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:68732 (67.1 KiB) TX bytes:68732 (67.1 KiB)


######### The /etc/network/interfaces file ###########
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.111 <http://192.168.1.111>
netmask 255.255.255.0 <http://255.255.255.0>
gateway 192.168.1.15 <http://192.168.1.15>

******%%%%%%**********%%%%%%%%%************%%%%%%%%%

AFTER MANUALLY CHANGING THE interfaces FILE TO USE DHCP
AND RESETTING THE ROUTER to FACTORY DEFAULTS
liberty:/home/greg# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.15.0 <http://192.168.15.0> * 255.255.255.0 <http://255.255.255.0> U
0 0 0 eth0
default 192.168.15.1 <http://192.168.15.1> 0.0.0.0 <http://0.0.0.0> UG 0 0 0
eth0

******%%%%%%**********%%%%%%%%%************%%%%%%%%%

AFTER SETTING THE ROUTER TO USE THE CONFIG I WANT
ROUTER=192.168.1.15 <http://192.168.1.15>,
TWO STATIC HOSTS .100 AND .111
DHCP SERVICE TO 25 HOSTS .125-.134
liberty:/home/greg# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 <http://192.168.1.0> * 255.255.255.0 <http://255.255.255.0> U 0
0 0 eth0
default 192.168.1.15 <http://192.168.1.15> 0.0.0.0 <http://0.0.0.0> UG 0 0 0
eth0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20050922/da5f2ce2/attachment.html


More information about the gnhlug-discuss mailing list