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: |
have you tried
#route add -net default gw 192.168.1.x netmask 0.0.0.0 metric 1 on the laptop? |
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 |
type this as root
route add -net default gw 192.168.1.x netmask 0.0.0.0 metric 1 see if that works :-) |
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. |
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. |
Re: Routing Sucess
Quote:
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 |
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. |