LinuxQuestions.org
Help answer threads with 0 replies.
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 05-24-2003, 09:54 AM   #1
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Rep: Reputation: 15
Exclamation routing


Hello,

i have a question
i have a linuxbak with 2 network cards

eth0 ip: 10.0.0.138/ 255.255.255.0 connected to the adsl router ip 10.0.0.138/255.255.255.0
eth1 ip: 192.168.1.1/255.255.255.0 connected with a swith and a pc 1p: 192.168.1.3/255.255.255.0

how can i edit the routing table so i can acces internet throw the linux machine or do i have to change my netmasks???


help me


greeting

Wimpie

Last edited by Wimpie22; 05-24-2003 at 10:02 AM.
 
Old 05-24-2003, 10:05 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Do you mean that you have other machines on the network that you want to let have internet access through linux. Like:
Code:
           [Internet]
               |
             (eth0)
           [Linux PC]
             (eth1)
               |
          [HUB/Switch]
           /   |   \
          /    |    \
       [PC1] [PC2] [PC3]
 
Old 05-24-2003, 10:38 AM   #3
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
yes can you help me bij giving me help

route add -net xx.xx.x.x.x..x

i have redhat linux 8.0

tnx
 
Old 05-24-2003, 10:43 AM   #4
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Re: routing

Quote:
Originally posted by Wimpie22
eth0 ip: 10.0.0.138/ 255.255.255.0 connected to the adsl router ip 10.0.0.138/255.255.255.0
I think it won't work. The IPs cannot be the same.
 
Old 05-24-2003, 10:45 AM   #5
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
ip etho 10.0.0.153
ip eth1 192.168.1.1

ip router 10.0.0.138

ip pc 192.168.1.3


sorry can you help me now??
 
Old 05-24-2003, 10:46 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
1)Set the default gateways on each PC on the inside of the linux router to being the IP address of the linux router.

2) Enable ip forwarding on the linux router only:
echo 1 > /proc/sys/net/ipv4/ip_forward

3) Enable ip masquerading on the linux router only:
$IPTABLES -A FORWARD -i 10.0.0.138 -o 192.168.1.1 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i 192.168.1.1 -o 10.0.0.138 -j ACCEPT
 
Old 05-24-2003, 11:37 AM   #7
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
hello

so i have to set on the pc

ip: 192.168.1.3
netmask 255.255.255.0
gateway 10.0.0.138

that does not work i think
 
Old 05-24-2003, 11:39 AM   #8
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
i have to upgrade my kernel or my iptables says linux how>?
 
Old 05-24-2003, 11:41 AM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
no - the gateway should be the 192.168.1.1 address.
did you run iptables an not ipchains? My commands shold have been:
/sbin/iptables -A FORWARD -i 10.0.0.138 -o 192.168.1.1 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i 192.168.1.1 -o 10.0.0.138 -j ACCEPT
 
Old 05-24-2003, 11:44 AM   #10
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
sorry i have installed 7.3 and not 8.0 is that the problem

greeting

wimpie
 
Old 05-24-2003, 11:46 AM   #11
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
i have iptables version 1.2.5

can that help you
 
Old 05-24-2003, 11:50 AM   #12
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Yes you will need to use ipchains:
/sbin/ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0/0
 
Old 05-24-2003, 11:56 AM   #13
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
hello

i have put in the line is that all

i can now telnet my router but i dont have a connection to internet my router give out ip adresses by dhcp but i put a static ip for my eth0 from my linux server can that be the problem
 
Old 05-24-2003, 01:31 PM   #14
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It could be a dns issue can you try the following two commands and see if you get any replies:
ping www.linuxquestions.org
ping 64.179.4.146
 
Old 05-24-2003, 01:40 PM   #15
Wimpie22
Member
 
Registered: May 2003
Posts: 85

Original Poster
Rep: Reputation: 15
Hello

Ping 64.179.4.146 works
ping www.linuxquestions.org does not work

so its a dns problem i gues
what can i do about it
 
  


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
routing jmono Linux - Networking 5 02-07-2006 06:20 AM
Routing gtkmike Linux - Networking 1 11-13-2003 09:21 AM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
Routing in RH 8.0 Hybrid Blue Linux - Networking 2 10-12-2003 05:41 PM
Routing jimval7 Linux - Networking 3 02-08-2002 04:06 PM

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

All times are GMT -5. The time now is 12:51 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
Open Source Consulting | Domain Registration