Thanks rohan but our gateway on 24 ip block so i need to do it on way that i send , unortunately this wont work becuase that is a global ip adress and they can not set a gateway for each 255 block for ex. i have 5 more ip 2 of them is on 78.159.xx.xx block so i need to set default gw to 217.20.117.1<br>
<br><div class="gmail_quote">2010/3/29 Rohan Gilchrist <span dir="ltr"><<a href="mailto:rohan@gilchrist.me">rohan@gilchrist.me</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
So you're saying that your default gateway is an IP address that's part of a *different* network/subnet?<br>
<br>
I don't know how this network has been designed, but typically I would expect that your default gateway would be something like<br>
<br>
188.72.255.1<br>
<br>
rather than 217.20.117.1 that you've mentioned earlier.<br>
<br>
Take a look at mine for example:<br>
<br>
[~]ifconfig<br>
eth0 Link encap:Ethernet HWaddr FE:FD:6D:4A:C1:69<br>
inet addr:109.xx.xxx.105 Bcast:109.74.193.255 Mask:255.255.255.0<br>
inet6 addr: fe80::fcfd:6dff:fe4a:c169/64 Scope:Link<br>
<div class="im"> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
</div> RX packets:78742 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:67114 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:1000<br>
RX bytes:35442733 (33.8 MiB) TX bytes:12607832 (12.0 MiB)<br>
<div class="im"><br>
lo Link encap:Local Loopback<br>
inet addr:127.0.0.1 Mask:255.0.0.0<br>
inet6 addr: ::1/128 Scope:Host<br>
UP LOOPBACK RUNNING MTU:16436 Metric:1<br>
</div> RX packets:8292 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:8292 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0<br>
RX bytes:1195297 (1.1 MiB) TX bytes:1195297 (1.1 MiB)<br>
<br>
[~]netstat -rn<br>
<div class="im">Kernel IP routing table<br>
Destination Gateway Genmask Flags MSS Window irtt Iface<br>
</div>109.xx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
<div class="im">169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0<br>
</div>0.0.0.0 109.xx.xxx.1 0.0.0.0 UG 0 0 0 eth0<br>
<br>
So you can see my host has .105 assigned to eth0, and the default gateway is .1 of the same network/subnet.<br>
<br>
You might want to check that your addressing is correct.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Mon, 29 Mar 2010, cahit Eyig?nl? wrote:<br>
<br>
> 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<br>
> before typing this my netstat -rn looks like this :<br>
> root@lin3 [~]# netstat -rn (that is not able to connect to internet)<br>
> Kernel IP routing table<br>
> Destination Gateway Genmask Flags MSS Window irtt Iface<br>
> 217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0<br>
> 188.72.255.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
> 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0<br>
> after adding gateway : (this works perfect)<br>
> root@lin3 [~]# netstat -rn<br>
> Kernel IP routing table<br>
> Destination Gateway Genmask Flags MSS Window irtt Iface<br>
> 217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0<br>
> 188.72.255.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
> 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0<br>
> 0.0.0.0 217.20.117.1 0.0.0.0 UG 0 0 0 eth0<br>
><br>
> i just want to add bold line automatically<br>
><br>
> and this is my ifconfig :<br>
> root@lin3 [~]# ifconfig -a<br>
> eth0 Link encap:Ethernet HWaddr 00:0C:29:83:21:44<br>
> inet addr:188.72.255.189 Bcast:188.72.255.255 Mask:255.255.255.0<br>
> inet6 addr: fe80::20c:29ff:fe83:2144/64 Scope:Link<br>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
> RX packets:9653 errors:0 dropped:0 overruns:0 frame:0<br>
> TX packets:458 errors:0 dropped:0 overruns:0 carrier:0<br>
> collisions:0 txqueuelen:1000<br>
> RX bytes:876648 (856.1 KiB) TX bytes:50814 (49.6 KiB)<br>
> Base address:0x2000 Memory:d8920000-d8940000<br>
><br>
> lo Link encap:Local Loopback<br>
> inet addr:127.0.0.1 Mask:255.0.0.0<br>
> inet6 addr: ::1/128 Scope:Host<br>
> UP LOOPBACK RUNNING MTU:16436 Metric:1<br>
> RX packets:483 errors:0 dropped:0 overruns:0 frame:0<br>
> TX packets:483 errors:0 dropped:0 overruns:0 carrier:0<br>
> collisions:0 txqueuelen:0<br>
> RX bytes:75305 (73.5 KiB) TX bytes:75305 (73.5 KiB)<br>
><br>
> sit0 Link encap:IPv6-in-IPv4<br>
> NOARP MTU:1480 Metric:1<br>
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br>
> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br>
> collisions:0 txqueuelen:0<br>
> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)<br>
><br>
><br>
><br>
> 2010/3/29 Matt Iavarone <<a href="mailto:matt.iavarone@gmail.com">matt.iavarone@gmail.com</a>><br>
</div></div>> 2010/3/29 cahit Eyig?nl? <<a href="mailto:cahit.eyigunlu@gmail.com">cahit.eyigunlu@gmail.com</a>>:<br>
<div class="im">> > This is my two line on route-eth0<br>
> > address0=217.20.117.1<br>
> > subnet0=255.255.255.255<br>
> > but what should be next line for default gateway the only thing that i could<br>
> > not complete is default gateway setting<br>
> > and my netstat table must looklike this :<br>
> > Destination Gateway Genmask Flags MSS Window irtt<br>
> > Iface<br>
> > 217.20.117.1 0.0.0.0 255.255.255.255 UH 0 0 0<br>
> > eth0<br>
> > xx.xx.xx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
> > 0.0.0.0 217.20.117.1 0.0.0.0 UG 0 0 0<br>
> > eth0<br>
> > and now i see only the first two line truely i am adding 3rd line on every<br>
> > time restart manually with route add default gw<br>
> ><br>
> > 2010/3/29 Les Mikesell <<a href="mailto:lesmikesell@gmail.com">lesmikesell@gmail.com</a>><br>
> >><br>
</div><div><div></div><div class="h5">> >> cahit Eyig?nl? wrote:<br>
> >> > i am reaching the network with this :<br>
> >> > route add -net 217.20.117.1 netmask 255.255.255.255 dev eth0<br>
> >> > route add default gw 217.20.117.1<br>
> >> ><br>
> >> > i have added eth0<br>
> >> > address0=217.20.117.1<br>
> >> > subnet0=255.255.255.255<br>
> >> ><br>
> >> > the first command is ok but how could i set the second command to cent<br>
> >> > os to do it automatically<br>
> >> ><br>
> >><br>
> >> If you create a file named /etc/sysconfig/network-scripts/route-eth0 you<br>
> >> can put<br>
> >> lines in it that will have 'ip route' added at the beginning and executed<br>
> >> after<br>
> >> the interface is up. "ip route" takes some different arguments than the<br>
> >> "route"<br>
> >> command - see "man ip" for details.<br>
> >><br>
> >> --<br>
> >> Les Mikesell<br>
> >> <a href="mailto:lesmikesell@gmail.com">lesmikesell@gmail.com</a><br>
> >><br>
> >><br>
> >><br>
> >> _______________________________________________<br>
> >> CentOS mailing list<br>
> >> <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
> >> <a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > CentOS mailing list<br>
> > <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
> > <a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
> ><br>
> ><br>
><br>
> Why don't you post the results of 'ifconfig -a' and 'ip route show'?<br>
> Giving information piecemeal is not helping anyone.<br>
> _______________________________________________<br>
> CentOS mailing list<br>
> <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
> <a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
><br>
><br>
><br>
><br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</div></div></blockquote></div><br>