March 11, 2009
How to: Configure huawei e220 mobile modem as a router on CentOS 5
This configuration assumes the following on your firewall computer:
- The network card IP is 192.168.1.2
- ppp0 is your mobile modem
- Enable IP forwading
# vi /etc/sysctl.conf
- Find
net.ipv4.ip_forward = 0
- Change to:
net.ipv4.ip_forward = 1
# echo 1 > /proc/sys/net/ipv4/ip_forward
# service network restart
- Enable IP masquerading
# service iptables stop
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# service iptables save
# service iptables restart
- Assign the IP address of the firewall computer to the gateway of the computers on the network.
- Go to the client computer
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
- Add this line:
GATEWAY=192.168.1.2
For Window computers, change Default gateway in the Internet Protocol(TCP/IP) to 192.168.1.2
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

