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 03-31-2003, 12:49 AM   #1
arobinson74
Member
 
Registered: Nov 2002
Location: Lone Tree, CO
Distribution: Xubuntu Gutsy
Posts: 174

Rep: Reputation: 30
Unhappy Intranet computers cannot see internet (need immediate help)


was using a WinME computer as my gateway with Norton firewall and thought it about time to swap it out with my Linux Computer. My Linux computer was on the network as a workstation with one NIC beforehand and working great. Here is what I did (btw running RedHat 8):

1. powered down computers
2. added 2nd NIC to the linux box
3. booted the linux box up
4. (getting odd @ address at prompt) after some research found I needed to remain my computer name in the network file. Contents of /etc/sysconfig/network now:
NETWORKING=yes
HOSTNAME=linux
FORWARD_IPV4=true

5. Could now connect to the internet from Linux.
6. Could not connect to linux from my windows computer.
7. Stopped IPTABLES (custom script, probably has errors).
8. Had a few more problems and realized named wasn't running.
9. Started service named
10. Now can see Linux fine from the windows computer, but cannot see the internet from the windows computer. Names are translating though (IE finds the IP, just can't connect).

This is where I am stuck. Looks like it may be due to forwarding or routing.

ifconfig output:
eth0 Link encap:Ethernet HWaddr 00:50:DA:07:33:C9
inet addr:12.252.107.87 Bcast:255.255.255.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26778 errors:0 dropped:0 overruns:0 frame:0
TX packets:3543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3971760 (3.7 Mb) TX bytes:559263 (546.1 Kb)
Interrupt:11 Base address:0xa800

eth1 Link encap:Ethernet HWaddr 00:A0:CC:3B:EA:9F
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8603 errors:1 dropped:0 overruns:0 frame:0
TX packets:7652 errors:12 dropped:0 overruns:0 carrier:0
collisions:162 txqueuelen:100
RX bytes:1030854 (1006.6 Kb) TX bytes:1380291 (1.3 Mb)
Interrupt:9 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:538 errors:0 dropped:0 overruns:0 frame:0
TX packets:538 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:70213 (68.5 Kb) TX bytes:70213 (68.5 Kb)


Route output:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
12.252.106.0 * 255.255.254.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 12-252-106-1.cl 0.0.0.0 UG 0 0 0 eth0

BTW, my IPTables script changes the kernel parms. Piece of the IPTables script (got this script from one of the tutorials on the IPTables web site):


/bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
/bin/echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
/bin/echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
for interface in /proc/sys/net/ipv4/conf/*/accept_redirects; do
/bin/echo "0" > ${interface}
done
/bin/echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
for interface in /proc/sys/net/ipv4/conf/*/rp_filter; do
/bin/echo "1" > ${interface}
done
/bin/echo "0" > /proc/sys/net/ipv4/conf/all/log_martians
/bin/echo "1" > /proc/sys/net/ipv4/ip_forward


I have IPTables accepting all at the moment until I get this working so that shouldn't be the issue.

Thank you.
 
Old 03-31-2003, 08:32 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
try the following lines:
#****** allow forwarding **********
iptables -A FORWARD -m state --state NEW -i eth1 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

if your eth0 ip is dynamic one: do masquerading
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

or in case of static ip:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source=12.252.107.87

should do.
and don't worry about lines like "/bin/echo "1" > ....." - they make some firewall settings
important is
/bin/echo "1" > /proc/sys/net/ipv4/ip_forward
which has to be to allow forwarding
 
Old 04-01-2003, 02:44 AM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Confirm the netmask and gateway numbers you need to use for eth0.
snip
eth0 Link encap:Ethernet HWaddr 00:50:DA:07:33:C9
inet addr:12.252.107.87 Bcast:255.255.255.255 Mask:255.255.254.0

That one looks very suspicious...
 
Old 04-01-2003, 09:24 AM   #4
arobinson74
Member
 
Registered: Nov 2002
Location: Lone Tree, CO
Distribution: Xubuntu Gutsy
Posts: 174

Original Poster
Rep: Reputation: 30
Got it working. Needed to add the forwarding lines to iptables to get it to work. When I had iptables "off" to test, I also had the forwarding rules off.
 
  


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
can not remote to server (neither intranet or internet) aardvark667 Linux - Newbie 3 04-12-2004 05:13 PM
can not remote to server (neither intranet or internet) aardvark667 Linux - Newbie 2 04-12-2004 01:13 PM
can not remote to server (neither intranet or internet) aardvark667 Linux - Newbie 1 04-12-2004 12:17 PM
IP addresses for internet and intranet GoTrolling Linux - Software 0 01-20-2004 02:49 PM
Cannot resolve intranet computers by name arobinson74 Linux - Networking 21 04-07-2003 02:09 PM

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

All times are GMT -5. The time now is 05:51 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