LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2004, 04:24 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
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?
 
Old 07-19-2004, 05:33 AM   #2
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
route add default gw <your gateway>

dont forget to restart the network service.
 
Old 07-19-2004, 05:37 AM   #3
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
If I type the command "route add default gw 10.5.5.1" the answer is:
SIOCADDRT:Network is unreachable
 
Old 07-19-2004, 05:39 AM   #4
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
whats the output of ifconfig?
 
Old 07-19-2004, 05:48 AM   #5
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
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)
 
Old 07-19-2004, 06:02 AM   #6
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
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?
 
Old 07-19-2004, 06:04 AM   #7
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
can you ping that gateway?
 
Old 07-19-2004, 06:05 AM   #8
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
try it this way:

route add -net default gateway <you gateway> dev eth0
 
Old 07-19-2004, 06:12 AM   #9
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
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
 
Old 07-19-2004, 06:18 AM   #10
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
if you cant ping the gateway, unless ping has been disabled for that server, then there is your problem.
 
Old 07-19-2004, 06:21 AM   #11
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
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.
 
Old 07-19-2004, 06:27 AM   #12
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
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).
 
Old 07-19-2004, 06:31 AM   #13
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
are you saying that you have a ADSL router? you have a static ip from your isp which is 212.200.122.123?
 
Old 07-19-2004, 06:36 AM   #14
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
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.
 
Old 07-19-2004, 07:05 AM   #15
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
Gubak

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcp does not set gateway pantoniades Linux - Networking 4 02-14-2006 05:26 AM
lm10.0 gateway is set but when I reboot I have to set the gateway rharvey32 Mandriva 8 02-13-2006 01:35 PM
Gateway set up xowl Slackware 1 02-04-2005 10:20 PM
How do I set up an Internet Gateway??? Kelv1979 Linux - Networking 7 08-21-2003 03:00 AM
trying to set up a gateway annehoog Linux - Newbie 6 05-12-2003 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration