LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-29-2005, 06:57 AM   #1
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Rep: Reputation: 0
Help me cant assign gateway to interface


hi All....

I have been given an assignment to bring one of the SME server which is based on (red hat platform) on internet...

i tried all but all in vain..

i ll let u knw the configurations..

im connected to the sme server by ssh 4m the system i want ot use it as gateway.....this system is Xandros..

now whn i type route -n in ssh to sme server i get


Destination Gateway Genmask Flags Metric Ref Use Iface
(222.111.9.0) 0.0.0.0 255.255.255.0 U 0 0 0 eth0
(127.0.0.0) 0.0.0.0 255.0.0.0 U 0 0 0 lo
(0.0.0.0) 222.111.9.30 0.0.0.0 UG 0 0 0 eth0

the host file in sme server is as follows..


127.0.0.1 localhost
222.111.9.1 shreyan-sme.shreyan.bus shreyan-sme

the hosts.allow is

#ALL:Shreyan-xandros.shreyan-xandros
only written the main option......

the hosts.deny file is

ALL:PARANOID

hosts.conf is

order bind hosts
multi on

resolv.conf is

nameserver XXXX.XXXX.XXXX.XXXX My Isp Dns

i want to assign the sme server of address 222.111.9.1 default gateway of 222.111.9.30 and use internet from the server.....

whn i use the following command

route add -net 222.111.9.1 gw 222.111.9.30 netmask 255.255.255.0 dev eth0
it shows netmask doesnt match route address...

plz tell me wat to do..

well im new to linux..any help will be helpful to me..


Thanks All.....

Last edited by shueib; 12-29-2005 at 07:01 AM.
 
Old 12-29-2005, 07:07 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 773
Blog Entries: 6

Rep: Reputation: 75
try netmask 255.255.255.255

ermm looks like u attempting to use korean ip_address in your LAN

dude. if LAN u LAN IP eg

(1)192.168.0.X/255
(2)192.168.1.X/255

then u can use netmask 255.255.255.0

Last edited by routers; 12-29-2005 at 07:20 AM.
 
Old 12-29-2005, 07:33 AM   #3
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
You are trying to assign a default gateway, correct? If so, the target used in the "route" command is 0.0.0.0/0. So...

Code:
route add -net 0.0.0.0/0 gw 222.111.9.30
-or- using the non CIDR method

Code:
route add -net 0.0.0.0 netmask 0.0.0.0 gw 222.111.9.30
BTW: If I understood your post correctly, then the default gateway of this system is already set to 222.111.9.30

Destination Gateway Genmask Flags Metric Ref Use Iface
(222.111.9.0) 0.0.0.0 255.255.255.0 U 0 0 0 eth0
(127.0.0.0) 0.0.0.0 255.0.0.0 U 0 0 0 lo
(0.0.0.0) 222.111.9.30 0.0.0.0 UG 0 0 0 eth0 <----
 
Old 12-29-2005, 07:38 AM   #4
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Original Poster
Rep: Reputation: 0
yes gateway is set but i dont knw y im not able to ping yahoo or any other sire 4m this server

it shows...
pinging www.yahoo.akadns.net [66.94.230.75] with 32 bytes of data:
destination net unreachable
 
Old 12-29-2005, 08:17 AM   #5
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally Posted by shueib
yes gateway is set but i dont knw y im not able to ping yahoo or any other sire 4m this server

it shows...
pinging www.yahoo.akadns.net [66.94.230.75] with 32 bytes of data:
destination net unreachable
Basically, the output from ping is stating it is unable to reach your network. duh!

Your route tables look good, although I do not know why the destination field of the "route -n" command is shown in parens.

1) Are you sure your network address is correct? i.e. 222.111.9.0/24

2) Are you sure the default gateway is correct for your network address?

3) Are you sure layers 1 and 2 of the network OSI model are working? i.e. cable plugged into NIC and a link lite.

4) type: ifconfig eth0
Check to see if the interface is transmitting/receiving data -or- if there are any errors associated with the interface. Also, is the broadcast address correct?

Thats all I got.
Good Luck!
 
Old 12-29-2005, 08:27 AM   #6
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Original Poster
Rep: Reputation: 0
yes the network address is correct ....

no i have written in parens for everyone to recognize its all congested thts y..

yes whn i ping 222.111.9.30 4m ...SME Server ie...222.111.9.1 it gets reply..

before adding the route i was getting message .for ping www.yahoo.com as unknown host ...after adding route im getting as..destination host unrechable.

by doing ifconfig i get

my ip as 222.111.9.1 netmask 255.255.255.0 and broadcast as 255.255.255.0
 
Old 12-29-2005, 09:26 AM   #7
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally Posted by shueib
yes the network address is correct ....

no i have written in parens for everyone to recognize its all congested thts y..

yes whn i ping 222.111.9.30 4m ...SME Server ie...222.111.9.1 it gets reply..

before adding the route i was getting message .for ping www.yahoo.com as unknown host ...after adding route im getting as..destination host unrechable.

by doing ifconfig i get

my ip as 222.111.9.1 netmask 255.255.255.0 and broadcast as 255.255.255.0
Check out your broadcast address. Based on your network address/netmask, it should be 222.111.9.255
 
Old 12-29-2005, 10:43 AM   #8
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Original Poster
Rep: Reputation: 0
oops broadcast is 222.111.9.255 ......any idea ...where the probs must be
 
Old 12-30-2005, 01:22 AM   #9
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Original Poster
Rep: Reputation: 0
tried the following command...

route add -net 222.111.9.1 gw 222.111.9.30 netmask 255.255.255.255 dev eth0

my route table shows.. route -n

Destination Gateway Genmask Flags Metric Ref Use Iface
222.111.9.1 222.111.9.30 255.255.255.255 UGH 0 0 0 eth0
222.111.9.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 222.111.9.30 0.0.0.0 UG 0 0 0 eth0

and whn i ping www.yahoo.com it shows..

PING www.yahoo.akadns.net (66.94.230.75) from 222.111.9.1 : 56(84) bytes of data.
From 23.1.1.5 icmp_seq=1 Destination Net Unreachable


???????????? any ideas.....................................
 
Old 12-31-2005, 09:01 AM   #10
thekillerbean
Member
 
Registered: Jan 2002
Distribution: Ubuntu 12.04.2 (Precise)
Posts: 89

Rep: Reputation: 16
Your routing table should look like below:

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
222.111.9.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         222.111.9.30    0.0.0.0         UG    0      0        0 eth0
Hope eradication of that first entry in the route table you had above clears your problem.
 
Old 01-02-2006, 12:34 PM   #11
shueib
LQ Newbie
 
Registered: Oct 2005
Location: Mumbai
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks friends....Finally im able to download rpm's 4m my server...by help of u all...

but knw wat...still whn i ping www.yahoo.com 4m server i get destination net unreachable...

but no worries now i have installed the rpms 4m internet...n my Assignment is complete..

Thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to change defualt gateway interface banner Linux - Networking 1 05-08-2005 12:47 PM
ip + interface + gateway alaios Debian 3 11-12-2004 05:35 PM
Odd problem: Gateway unreachable after certain amount of time (Win XP Gateway) SocialEngineer Linux - Networking 2 08-13-2004 01:54 AM
Why does my internet interface keep getting a gateway silence Linux - Networking 2 06-18-2004 12:34 PM
LAN interface on Gateway stops being able to send info to LAN intermittantly. BurnFEST Debian 2 11-01-2003 04:16 AM


All times are GMT -5. The time now is 06:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration