LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How can I set Gateway? (https://www.linuxquestions.org/questions/linux-networking-3/how-can-i-set-gateway-206852/)

gubak 07-19-2004 04:24 AM

How can I set Gateway?
 
I use RedHat9.
I already set the network (ip: 212.200.122.123, mask: 255.255.255.248, Gateway: 10.5.5.1) but if I type the command netstat -nr (to see the routing table) I get the data:
Destination: 212.200.122.120
Gateway: 0.0.0.0
Genmask: 255.255.255.248
Flags: U
MSS Windows: 0 0
etc.
I see thet the the Gateway is 0.0.0.0 , but I set it to 10.5.5.1 .
What is the problem? How can I set the gateway?

Frustin 07-19-2004 05:33 AM

route add default gw <your gateway>

dont forget to restart the network service.

gubak 07-19-2004 05:37 AM

If I type the command "route add default gw 10.5.5.1" the answer is:
SIOCADDRT:Network is unreachable

Frustin 07-19-2004 05:39 AM

whats the output of ifconfig?

gubak 07-19-2004 05:48 AM

eth0 Link encap:Ethernet HWaddr 00:30:4F:12:14:E6
inet addr:212.200.122.123 Bcast:212.200.122.127 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5220 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:1 txqueuelen:100
RX bytes:391998 (382.8 Kb) TX bytes:300 (300.0 b)
Interrupt:5 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:700 (700.0 b) TX bytes:700 (700.0 b)

gubak 07-19-2004 06:02 AM

I find some words about gateways:


"gw GW
route packets via a gateway. NOTE: The specified gateway must
be reachable first. This usually means that you have to set up a
static route to the gateway beforehand. If you specify the
address of one of your local interfaces, it will be used to
decide about the interface to which the packets should be routed
to. This is a BSDism compatibility hack. "



It says that I first have to make a static route. How can I do this?

Frustin 07-19-2004 06:04 AM

can you ping that gateway?

Frustin 07-19-2004 06:05 AM

try it this way:

route add -net default gateway <you gateway> dev eth0

gubak 07-19-2004 06:12 AM

I can't ping that gateway.
If I type the command "route add -net default gateway 10.5.5.1 dev eth0" the answer is the same : SIOCADDRT: Network is unreachable

Frustin 07-19-2004 06:18 AM

if you cant ping the gateway, unless ping has been disabled for that server, then there is your problem.

Frustin 07-19-2004 06:21 AM

wait a minute, i just realised your gateway is on a completely different network address to the one in your ifconfig settings.

you are trying to use a gateway on a 10.*.*.* network when you are on a 212.*.*.* network, find the address of that gateway and use that.

gubak 07-19-2004 06:27 AM

But I can't because I bought the public address 212.200.122.123 and I must to use it, but I'm connected to the internet through this gateway (10.5.5.1).

Frustin 07-19-2004 06:31 AM

are you saying that you have a ADSL router? you have a static ip from your isp which is 212.200.122.123?

gubak 07-19-2004 06:36 AM

I don't know what does it mean ADSL router.
I know that I have a public IP (static IP), and I got it from my ISP.

ppuru 07-19-2004 07:05 AM

Gubak

How does this IP get assigned to your Windpws system 212.200.122.123? by DHCP? or have you typed in this address?


All times are GMT -5. The time now is 11:51 AM.