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
  1. Enable IP forwading
    1. # vi /etc/sysctl.conf
    2. Find
      net.ipv4.ip_forward = 0
    3. Change to:
      net.ipv4.ip_forward = 1
    4. # echo 1 > /proc/sys/net/ipv4/ip_forward
    5. # service network restart
  2. Enable IP masquerading
    1. # service iptables stop
    2. # iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
    3. # service iptables save
    4. # service iptables restart
  3. Assign the IP address of the firewall computer to the gateway of the computers on the network.
    1. Go to the client computer
    2. # vi /etc/sysconfig/network-scripts/ifcfg-eth0
    3. 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)

Spread the word

del.icio.us Digg Furl Reddit Help

Permalink • Print

Related Entries

Made with WordPress and a healthy dose of Semiologic • Sky Gold skin by Denis de Bernardy