LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-13-2009, 08:40 AM   #1
kashif2131971
Member
 
Registered: Mar 2008
Posts: 60

Rep: Reputation: 16
how to define gateway on network card


I have two network card in my computer.

1. eth0 is set to automatic obtain IP from provider (DHCP)
2. wifi0 is set to static IP (local) 192.168.1.1

My ifcfg-wifi0 is configure in /etc/sysconfig/network-scripts/ifcfg-wifi0 as below

# Atheros Communications, Inc. AR5212 802.11abg NIC
DEVICE=wifi0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0
HWADDR=00:17:9A:75:48:37

my /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=pc1.homeserver.in

eth0 IP is connected to broadBand internet service provider device WiMax and IP change time to time from internet service provider.How can I get IP for gateway in /etc/sysconfig/network

I am using Redhat enterprise Linux 4

kindly help
regards

Last edited by kashif2131971; 07-13-2009 at 08:42 AM. Reason: for clear understanding to forum member
 
Old 07-13-2009, 08:47 AM   #2
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Rep: Reputation: 0
I think you can use "traceroute www.google.com" see what is the next. it is you gateway!
 
Old 07-13-2009, 09:07 AM   #3
kashif2131971
Member
 
Registered: Mar 2008
Posts: 60

Original Poster
Rep: Reputation: 16
gateway problem

thanks for your reply
after using as your advice traceroute command the list is displayed and my device is mygateway1.Motorola and IP is 192.168.15.1 but i change because of DHCP connect may I put device name in my /etc/sysconfig/network
file like that
orignal:
NETWORKING=yes
HOSTNAME=pc1.homeserver.in


NETWORKING=yes
HOSTNAME=pc1.homeserver.in
GATEWAY= mygateway1.motorola

its work or not?
 
Old 07-13-2009, 10:17 AM   #4
kashif2131971
Member
 
Registered: Mar 2008
Posts: 60

Original Poster
Rep: Reputation: 16
assigning gateway

or simply the name of NIC which is configure to internet in my case eth0
because the IP change because of DHCP congiruation of Internet provider:

NETWORKING=yes
HOSTNAME=pc1.homeserver.in
GATEWAY= eth0
 
Old 07-14-2009, 02:53 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by kashif2131971 View Post
or simply the name of NIC which is configure to internet in my case eth0
because the IP change because of DHCP congiruation of Internet provider:

NETWORKING=yes
HOSTNAME=pc1.homeserver.in
GATEWAY= eth0

Code:
NETWORKING=yes
HOSTNAME=pc1.homeserver.in
GATEWAY= mygateway1.motorola

this way would work providing the gateway is a valid host and is reachable
if dhcp is setting the gateway, then thats different. it will probably change that anyway, unless you turn dhcp off

Last edited by centosboy; 07-14-2009 at 02:57 AM.
 
Old 07-16-2009, 09:28 AM   #6
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Rep: Reputation: 0
If you want have a static public IP then you best buy it! Alternative use DDNS to resolve you domain.

If you don't want to build a server that service for internet, then ip change isn't influence with you.
 
  


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
Need to define a second gateway on Mandrake 9.2 Maldain Mandriva 1 01-03-2006 03:58 PM
Unable to manually define default Gateway Xandor Linux - Networking 6 11-29-2005 04:35 AM
How define virtual network interface in Suse 9.3 ? tkmbe Suse/Novell 0 08-08-2005 04:21 PM
Need help to define network in slackware 10.1 shemesh Linux - Networking 3 04-29-2005 12:06 PM
Define a fixed Browsemaster for samba network TroelsSmit Linux - Networking 4 11-18-2004 11:25 AM


All times are GMT -5. The time now is 09:55 AM.

Main Menu
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