LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Routing, IP Masquerading and Cable Modem (https://www.linuxquestions.org/questions/linux-networking-3/routing-ip-masquerading-and-cable-modem-137254/)

ad3 01-21-2004 06:18 PM

Routing, IP Masquerading and Cable Modem
 
Although I went to school for Linux, experience is where its at.

hey guys i was wondering if you could shed some light on a problem i am having, i am pretty close but i am unable to get a linux box i am trying to use as a router/fw.

I am using redhat 9.1 box with dual nics, eth0 uses dhcp, and eth1 has a private 192.168.1.x ip address. The other machine, a laptop redhat 7.3x is connected via x-over cable to eth1 of the router/gw.

I am using iptables (not sure how well though) and have enabled port fowarding.

I am able to ping each machine and the router/fw can ping the internet.

My isp is roadrunner and i think i should be using IP masq enabled via NAT, but not sure of the -to ip address i should be using?

If i use roadrunner's assigned ip 24.161.232.x i get an invalid argument.

I can run traceroutes from eth1 of the router/fw to the laptops eth0 and vice-versa, if i try pinging the internet from the laptop , i get unknown host, also cannot ping an internet site.

I have also added to the /etc/resolv.conf file in the laptop to use roadrunner's nameservers. What am i doing wrong?

Should i be setting up eth0 on the router/fw to be static and then use dhcpd to handle the ip to the Internet?:confused: :confused: :confused:

krazeivan 01-21-2004 07:33 PM

have you tried
#route add -net default gw 192.168.1.x netmask 0.0.0.0 metric 1
on the laptop?

ad3 01-21-2004 08:35 PM

no i have not i can post my router/fw route table also if it will help.
thanks for the reply.

this is the router/fw route table:

Destination Gateway Genmask Flags Metric Ref Use Iface
24.73.50.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 24.73.50.1 0.0.0.0 UG 0 0 0 eth0

here is ifconfig's output:

eth0 Link encap:Ethernet HWaddr
inet addr:24.73.51.216 Bcast:255.255.255.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2828 errors:0 dropped:0 overruns:0 frame:0
TX packets:355 errors:0 dropped:0 overruns:0 carrier:0
collisions:5 txqueuelen:100
RX bytes:305442 (298.2 Kb) TX bytes:53509 (52.2 Kb)
Interrupt:9 Base address:0xe800

eth1 Link encap:Ethernet HWaddr
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3120 (3.0 Kb) TX bytes:480 (480.0 b)
Interrupt:10 Base address:0xb000

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:2311 errors:0 dropped:0 overruns:0 frame:0
TX packets:2311 errors:0 dropped:0 overruns:0 carrier:0

krazeivan 01-21-2004 09:15 PM

type this as root
route add -net default gw 192.168.1.x netmask 0.0.0.0 metric 1

see if that works :-)

ad3 01-28-2004 12:01 PM

i'll figure it out from http://linux-ip.net

now that i am looking at it;
192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth1
is using a default route (0.0.0.0), i may want to use a static route instead.

ad3 02-09-2004 11:26 AM

Routing Sucess
 
After a week of tinkering and reading, i figured out how to set up a linux box to act as a fw/router using ip masquerading. Thanks to those who offered help.

Anyone who comes across this article and has any questions, perhaps i will be able to offer some assistance.

dude_228 02-24-2004 08:50 PM

Re: Routing Sucess
 
Quote:

Originally posted by ad3
After a week of tinkering and reading, i figured out how to set up a linux box to act as a fw/router using ip masquerading. Thanks to those who offered help.

Anyone who comes across this article and has any questions, perhaps i will be able to offer some assistance.

Hey
Good job you got it working. I am really trying out the ip mastequerading, but all these guides seem long and confusing. Is there any actual file or commands to use to get it trying fast with iptables.
Thanks

ad3 02-25-2004 07:48 AM

i don't understand what yor saying in this sentence "to get it trying fast with iptables"

If your are referring to a setting up iptables with minimial amount of security, that can be possible (although not suggested). I can post a firewall script that i basically pieced together from my research and reading
books and articles.


All times are GMT -5. The time now is 05:06 PM.