linux as router

wezhira

Well-Known Member
Joined
Jun 15, 2008
Messages
467
Reaction score
5
hi guys i need some help setting up a linux box as a router n i use my phone as a 3g modem using wvdial on fedora 8 dual booting with ubuntu 8.04 now i wanna share this connection with my other box whach has solaris and opensuse on it the pc has 3 network cards in case i get more computers now i'm not able too share this connection ive read so many tutorials but most of these tutorials dont take usb modem into consideration ive even tried apps like firestarter but too no avail can any one help me
 
Turn your computer into a gateway, ie set up DHCP and assign IP addresses to the computers connected.
The best you can do, however, is to do the following: <3G modem>--<linux box>==switch/hub<<<computers. This is by far the best way to do it.
 
yeah well its the setting up computer as a gateway i'm having a problem with
 
What is your network device for the 3G modem? Let's say it's ppp0, then do this on the linux box:

Code:
iptables -i ppp0 -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

You will, of course, want to have other rules in there to prevent people from poking around on your box :D
 
thanx will try that uhm wat do i enter on the other machine although ive been using linux for a while i've never networked will the other pc pick it up automatically when it boots
 
you need to set the other machine's gateway to be the IP address of the network card on your "router" pc. It won't pick it up automatically unless you set up a DHCP server on the router pc
 
righrt like i said earlier never done the networking bit or used a router on linux but thanx gonna try it out see what happens post my results here
 
Top
Sign up to the MyBroadband newsletter
X