LinuxQuestions.org
Register a domain and help support LQ
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 05-27-2010, 01:50 PM   #1
Hiroshi
LQ Newbie
 
Registered: Apr 2010
Posts: 20

Rep: Reputation: 0
OEL5.4 OS, eth0 has private IP, eth0:0 has routable IP, internet access don't work


I have a OEL5.4 server with a eth0 set up with private IP (non-routable), I've added eth0:0 with a routable IP address.

I've used:
# ifconfig eth0:0 routable-IP netmask ----- broadcast ------
and
# route add default gw gw-IP-address eth0:0

commands to set up eth0:0.

How do I tell firefox to use eth0:0 to be able to access the internet?

Any help would be highly appreciated; thanks in advance.
 
Old 05-27-2010, 03:19 PM   #2
matpe
LQ Newbie
 
Registered: May 2010
Location: Linköping, Sweden
Distribution: Gentoo
Posts: 13

Rep: Reputation: 2
Did you set the nameserver in /etc/resolv.conf ?
Can you ping the default gateway?

Usually, firefox should find its way out through the default gateway by itself.
 
Old 05-27-2010, 05:12 PM   #3
Hiroshi
LQ Newbie
 
Registered: Apr 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by matpe View Post
Did you set the nameserver in /etc/resolv.conf ?
Can you ping the default gateway?

Usually, firefox should find its way out through the default gateway by itself.
Thanks for your quick reply. Below please see some notes:

1- Yes, I have /etc/resolv.conf pointing to correct name servers.
2- Yes, I'm able to ping the default gateway.

3- Just an added note: eth0:0 shows up under "ifconfig -a" command with correct parameters. I can ping eth0:0 using its IP. But, when I bring up "system-config-network", it doesn't have an entry for eth0:0.

4- The server was originally set up with private IP as its main IP. Do I need to change server's IP to this new rout-able one?
 
Old 05-28-2010, 04:07 AM   #4
matpe
LQ Newbie
 
Registered: May 2010
Location: Linköping, Sweden
Distribution: Gentoo
Posts: 13

Rep: Reputation: 2
I did try to set up a network config almost exactly as you have. This is what I did:
Code:
# ifconfig eth0 10.0.0.1/24
# ifconfig eth0:0 192.99.99.128/24
# route add default gw 192.99.99.1
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.99.99.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         192.99.99.1     0.0.0.0         UG    0      0        0 eth0
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:19:db:20:00:c0  
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::219:dbff:fe20:c0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2477 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2990711 (2.8 MiB)  TX bytes:374394 (365.6 KiB)
          Interrupt:23 Base address:0xd000 

eth0:0    Link encap:Ethernet  HWaddr 00:19:db:20:00:c0  
          inet addr:192.99.99.128  Bcast:192.99.99.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:23 Base address:0xd000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:25 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3221 (3.1 KiB)  TX bytes:3221 (3.1 KiB)

# cat /etc/resolv.conf 
nameserver 192.99.99.252
# ping -c 1 www.linuxquestions.com
PING www.linuxquestions.com (174.137.125.95) 56(84) bytes of data.
64 bytes from mdnh-parking-adult.phl.marchex.com (174.137.125.95): icmp_seq=1 ttl=241 time=127 ms

--- www.linuxquestions.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 127.084/127.084/127.084/0.000 ms
# ping -c 1 10.0.0.2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.833 ms

--- 10.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.833/0.833/0.833/0.000 ms
#
The 10.0.0.2 is a different host connected to the same switch. 192.99.99.0/24 is not my real net.

How is this different from your setup?
 
Old 05-28-2010, 03:08 PM   #5
TimothyEBaldwin
Member
 
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
What does "ip route show" reveal?
 
Old 05-28-2010, 04:15 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
I'll ask.

Shouldn't the public ip have a gateway?
 
Old 06-01-2010, 03:19 PM   #7
Hiroshi
LQ Newbie
 
Registered: Apr 2010
Posts: 20

Original Poster
Rep: Reputation: 0
[QUOTE=matpe;3983880]I did try to set up a network config almost exactly as you have. This is what I did:
[CODE]# ifconfig eth0 10.0.0.1/24
# ifconfig eth0:0 192.99.99.128/24
# route add default gw 192.99.99.1
# route -n

matpe - Thanks so much for your useful post, but that only works dynamically. The real problem is that after a reboot it doesn't work anymore. Below please find how I've set up my network related files:

1- /etc/sysconfig/network ==> I populated "GATEWAY=" field with the gateway of my public address.

2- /etc/sysconfig/network-scripts/ifcfg-eth0 ==> I populated this file with my private IP information.

3- /etc/sysconfig/network-scripts/ifcfg-eth0:0 ==> I populated this file with my public IP information.

After a reboot I don't have internet access, when I issue ifconfig command don't see an entry for eth0:0, and my eth0 has the public IP assigned to it (although the file ifcfg-eth0 has my private IP info).


All, what am I doing wrong? How should these files be set up for everything to be configured right after a reboot?

Many thanks in advance for everyone's input.
 
Old 06-02-2010, 01:49 PM   #8
Hiroshi
LQ Newbie
 
Registered: Apr 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Red face

This was a "user error". When configuring /etc/sysconfig/network-scripts/ifcfg-eth1:0 file for the public IP, I had forgotten to change the "DEVICE=" field to eth1:0. And since this was a cp of the /etc/sysconfig/network-scripts/ifcfg-eth1 file, it created a conflict. As soon as I corrected this file, everything worked just fine.

All - Thank you very much for your replies.
 
  


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
eth0 fixed IP. eth1 DHCP gateway. Need access to eth0 fopetesl Linux - Networking 69 02-01-2010 04:45 AM
Routing Question with eth0 private (192.x.x.x) and eth1 public (234.x.x.x) SteveJenkins Linux - Newbie 3 11-28-2009 10:11 AM
Toshiba A135-Not Internet access-(eth0,eth1 devices not found) jcrphx Linux - Laptop and Netbook 3 07-31-2007 09:16 PM
Problem withInternet, DHCP, connect with eth0 down work, connect with eth0 up not zowey Linux - Networking 1 03-12-2004 11:05 AM
sharing internet through eth0 to sl0, iptables wont work Oxagast Linux - Networking 2 08-11-2003 08:36 PM


All times are GMT -5. The time now is 02:21 AM.

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