[CentOS] Forgetting network settings
cahit Eyigünlü
cahit.eyigunlu at gmail.com
Mon Mar 29 13:40:52 UTC 2010
there is no problem with my internet connection i just want that to do this
cent os automatically :
route add default gw 217.20.117.1
before typing this my netstat -rn looks like this :
root at lin3 [~]# netstat -rn (that is not able to connect to internet)
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0
eth0
188.72.255.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
eth0
after adding gateway : (this works perfect)
root at lin3 [~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0
eth0
188.72.255.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
eth0
*0.0.0.0 217.20.117.1 0.0.0.0 UG 0 0 0
eth0 *
i just want to add bold line automatically
and this is my ifconfig :
root at lin3 [~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:83:21:44
inet addr:188.72.255.189 Bcast:188.72.255.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe83:2144/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9653 errors:0 dropped:0 overruns:0 frame:0
TX packets:458 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:876648 (856.1 KiB) TX bytes:50814 (49.6 KiB)
Base address:0x2000 Memory:d8920000-d8940000
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:483 errors:0 dropped:0 overruns:0 frame:0
TX packets:483 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:75305 (73.5 KiB) TX bytes:75305 (73.5 KiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
2010/3/29 Matt Iavarone <matt.iavarone at gmail.com>
> 2010/3/29 cahit Eyigünlü <cahit.eyigunlu at gmail.com>:
> > This is my two line on route-eth0
> > address0=217.20.117.1
> > subnet0=255.255.255.255
> > but what should be next line for default gateway the only thing that i
> could
> > not complete is default gateway setting
> > and my netstat table must looklike this :
> > Destination Gateway Genmask Flags MSS Window irtt
> > Iface
> > 217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0
> > eth0
> > xx.xx.xx.0 0.0.0.0 255.255.255.0 U 0 0 0
> eth0
> > 0.0.0.0 217.20.117.1 0.0.0.0 UG 0 0 0
> > eth0
> > and now i see only the first two line truely i am adding 3rd line on
> every
> > time restart manually with route add default gw
> >
> > 2010/3/29 Les Mikesell <lesmikesell at gmail.com>
> >>
> >> cahit Eyigünlü wrote:
> >> > i am reaching the network with this :
> >> > route add -net 217.20.117.1 netmask 255.255.255.255 dev eth0
> >> > route add default gw 217.20.117.1
> >> >
> >> > i have added eth0
> >> > address0=217.20.117.1
> >> > subnet0=255.255.255.255
> >> >
> >> > the first command is ok but how could i set the second command to cent
> >> > os to do it automatically
> >> >
> >>
> >> If you create a file named /etc/sysconfig/network-scripts/route-eth0 you
> >> can put
> >> lines in it that will have 'ip route' added at the beginning and
> executed
> >> after
> >> the interface is up. "ip route" takes some different arguments than the
> >> "route"
> >> command - see "man ip" for details.
> >>
> >> --
> >> Les Mikesell
> >> lesmikesell at gmail.com
> >>
> >>
> >>
> >> _______________________________________________
> >> CentOS mailing list
> >> CentOS at centos.org
> >> http://lists.centos.org/mailman/listinfo/centos
> >
> >
> > _______________________________________________
> > CentOS mailing list
> > CentOS at centos.org
> > http://lists.centos.org/mailman/listinfo/centos
> >
> >
>
> Why don't you post the results of 'ifconfig -a' and 'ip route show'?
> Giving information piecemeal is not helping anyone.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20100329/296c00f5/attachment.html>
More information about the CentOS
mailing list