Internet Connection Share on Linux(ArchLinux)
2012-04-22 08:46
302 查看
Internet ConnectionShare on Linux
(tested in archlinux)
you must have more thanone network card in you host computer
mine one wired Gigabitcard, another a wireless card
I used the wirelesscard connecting to the internet work, so there is a ppp0 connection
wired card config :
ip: 192.168.1.1/24
wireless card get theip just from the wireless AP
then the other computerthat you want to share connection with must connect to you wired cardan hava this configration :
ip: 192.168.1.2/24
gateway: 192.168.1.1
Nat Sharing Steps:
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -F
iptables -P INPUTACCEPT
iptables -P FORWARDACCEPT
iptables -t nat -APOSTROUTING -o ppp0 -j MASQUERADE
rc.d save iptables
rc.d start iptables
#you can also share youethernet connection, to do so just replace ppp0 by ethx
#get the DNS Server
(your must first sufferthe internet first)
cat /etc/resolv.conf
#then set the output tothe sharing computer's /etc/resolv.conf file
(tested in archlinux)
you must have more thanone network card in you host computer
mine one wired Gigabitcard, another a wireless card
I used the wirelesscard connecting to the internet work, so there is a ppp0 connection
wired card config :
ip: 192.168.1.1/24
wireless card get theip just from the wireless AP
then the other computerthat you want to share connection with must connect to you wired cardan hava this configration :
ip: 192.168.1.2/24
gateway: 192.168.1.1
Nat Sharing Steps:
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -F
iptables -P INPUTACCEPT
iptables -P FORWARDACCEPT
iptables -t nat -APOSTROUTING -o ppp0 -j MASQUERADE
rc.d save iptables
rc.d start iptables
#you can also share youethernet connection, to do so just replace ppp0 by ethx
#get the DNS Server
(your must first sufferthe internet first)
cat /etc/resolv.conf
#then set the output tothe sharing computer's /etc/resolv.conf file
相关文章推荐
- How To Share The Internet Connection Between Mac and PC
- Mount Windows/CIFS Share on Linux Mint
- error linux connection to mysql server on 10065
- 用 Linux 分享网际网路连线 (Internet Connection Sharing)
- Use ADSL connect to internet on Linux OS
- share network connection on windows
- Share folders on your local Windows PC to remote Linux PC
- Speed up your Internet browsing on Linux with a DNS Cache server
- How To Install Speedtest-cli On a CentOS / RHEL / Scientific / Fedora Linux To Check Internet Speed
- Remote Share with NFS on Linux
- How to mount Windows share on Red Hat Enterprise Linux system using CIFS
- Internet services on Linux
- red hat linux 安装 ruby on rails
- Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 5
- Linux写时拷贝技术(copy-on-write)
- On-Designing-and-Deploying-Internet-Scale-Services
- JFreeChart在Linux下图片不显示 No JFreeChart object found on the stack with name chart
- 设计和部署互联网级别的可扩展服务--On Designing and Deploying Internet-Scale Services
- How to run OFBiz as a Service on linux