منتدى ثقافى أجتماعى
 
الرئيسيةالبوابةأحدث الصورالتسجيلدخول

شاطر  | 
 

 حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت

استعرض الموضوع التالياستعرض الموضوع السابقاذهب الى الأسفل
كاتب الموضوعمن فضلك أقرأ الموضوع بعمق وأضف رد يعبر عن فهمك لمضمونه
Admin
1
1
Admin

عدد الرسائل : 3215
نقاط التقييم : 89210
المهنة : أستاذ جامعى
مقياس النشاط
حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Left_bar_bleue90 / 10090 / 100حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Right_bar_bleue

100

^ : ^

تكريم الأعضاء -

حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت 3h5910



حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Empty
مُساهمةموضوع: حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت  حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Icon_minitime2011-03-26, 13:34أنت الرقيب على نفسك

المصدر :- منتدى الشبكة العربية
إضافة تقييم للموضوعالكاتب :- Admin
 
حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت


Introduction



Internet Connection Sharing (ICS) provides the ability for one computer to share its Internet connection with another computer. To do this, a computer with an Internet connection must be configured to function as an Internet gateway. A second computer (or network of computers) connects to the Internet indirectly via the gateway computer.

Situations in which ICS may be necessary include:

  • dial up connection
  • authenticated (PPPoA/E) connection
  • wireless connection
  • When it is impractical (such as with distance) to run multiple network cables to each computer.



GUI Method via Network Manager (Ubuntu 9.10 and up)



In order to share an Internet connection, the computer that will do the sharing must have two network cards or ports. This assumes that you are using at least one Ethernet port and that it is identified as "eth0". eth0 will be the port that other computers will connect to you on.

When you are logged in:

  • Go to "System" on your top bar
  • Navigate to "Preferences" and select "Network Connections"
  • When that window opens, select "Auto eth0" and press "Edit" (This assumes that you are connected to the internet on some other port, for ex. wlan0 using wireless)


A new window will open. Navigate to the tab titled "IPv4 Settings" and change the Method to "Shared to other computers". After restarting the computer you should now be able to plug in any computer into your other Ethernet port or share through your wireless card.

Note: To clarify the above example here is an example configuration that will work -

  1. You are already connected to the internet using your wireless on port wlan0
  2. The ethernet port eth0 is connected to the PC that needs to share your internet connection (or you could wire eth0 to a router for multiple machines)


Note: in the case of connecting a router, especially one with wireless, where you want the users to share your connection:



  1. Check before you start (in Synaptic or with dpkg-query -l dnsmasq*) that dnsmasq-base is installed and that dnsmasq is not installed. Install or uninstall as appropriate (see next section).
  2. After connecting the router, to enable masquerading, type: sudo iptables -t nat -A POSTROUTING -j MASQUERADE



Wireless Ad-Hoc connection sharing scenario



Step by step guide:

  • dnsmasq-base has to be installed: sudo apt-get install dnsmasq-base


  • remove dnsmasq as it's conflicting with NetworkManager: sudo apt-get remove dnsmasq


  • restart NetworkManager: sudo /etc/init.d/network-manager restart


  • Add a new wireless network with NetworkManager (left-click on NetworkManager icon, then select "Create New Wireless Network")


  • Call the new network "UbuntuAdhoc" (note: if you choose another name you will have to turn on connection sharing later by editing the network you just created!)


  • Set encryption to "WEP40..." (note: you may have to experiment here according to what type of encryption with ad-hoc the phone/other laptop/pc supports, wpa is not supported)


NetworkManager now should connect to itself (which means it creates the ad-hoc wireless network and routes any internet traffic to your wired network interface). Now connect with the client(s) and you should have a working internet connection.


Ubuntu Internet Gateway Method (iptables)



You will need two network cards in the gateway computer, or a PPP interface and a network card. One network card (or PPP interface) connects to the internet, we will call this card eth0. The other card connects to your internal network, we will call this eth1. It is also possible to do ICS with a single network card. In this case, use eth0 for the internet and eth0:0 for the internal network.



  1. Internet <<==>> eth0 <> Ubuntu gateway <> eth1 <<==>> Client PC


  2. Internet <<==>> ppp0 <> Ubuntu gateway <> eth1 <<==>> Client PC


  3. Internet <<==>> eth0 <> Ubuntu gateway <> eth0:0 <<==>> Client PC



Gateway set up



The following example will focus on the most common gateway setup; an Ubuntu computer with two wired network adapters (eth0 and eth1) hosting ICS to a static internal network configured for the 192.168.0.x subnet.

For this example, eth0 is used to represent the network card connected to the internet and eth1 represents the network card connected to a client PC. You can replace eth0 and eth1 as needed for your situation. Also, any private IP subnet can be used for the internal network IP addresses.

In summary:



  • eth0 = the network adapter with internet (external or WAN).
    eth1 = the network adapter to which a second computer is attached (internal or LAN).
    192.168.0.x = IP subnet for eth1


Your setup may be different. If so, make sure to change them accordingly in the following commands.


Configure internal network card



Configure your internal network card (eth1) for static IP like so: sudo ifconfig eth1 192.168.0.1

(The external and internal network cards cannot be on the same subnet)
Configure NAT



Configure iptables for NAT translation so packets can be correctly routed through the Ubuntu gateway. sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE

(rule1 allows forwarded packets (initial ones), rule2 allows forwarding of established connection packets (and those related to ones that started), rule3 does the NAT.)

IPtables settings need to be set-up at each boot (they are not saved automatically), with the following commands:

  • Save the iptables:


sudo iptables-save | sudo tee /etc/iptables.sav

  • Edit /etc/rc.local and add the following lines before the "exit 0" line:


iptables-restore < /etc/iptables.sav


Enable routing



  • Configure the gateway for routing between two interfaces by enabling IP forwarding:


sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"



  • Edit /etc/sysctl.conf and add these lines:


net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1

The /etc/sysctl.conf edit is required because of following Bug (Hardy and later releases) Launchpad Bug Report


Client set up



Any OS can connect to the internet as an ICS client as long as networking has been configured correctly. The following example will focus on how to set up an Ubuntu ICS client. For this example, it is assumed that the client is connected to an Ubuntu gateway which has been configured to share ICS on the 192.168.0.x subnet according to the gateway set up outlined above.

For this example, eth0 is the network card on the client which is connected (by crossover cable) to eth1 on the Ubuntu gateway. You can replace eth0 as needed for your situation. Also, any private IP subnet can be used for the internal network IP address, as long as it matches the subnet on the gateway.
Disable networking



sudo /etc/init.d/networking stop


Give the client a static IP address



sudo ifconfig eth0 192.168.0.100

This IP address can be anything within the gateway's private IP range.
Configure routing



sudo route add default gw 192.168.0.1

This address should match the IP address on the gateway's internal network card (eth1 in the above example).
Configure DNS servers



Unless your ICS gateway can also perform DNS, you must manually configure the client with your ISP DNS servers. If you do not know your ISP's DNS servers, you can use OpenDNS servers instead.

  • Backup your current /etc/resolve.conf file:


sudo cp /etc/resolv.conf /etc/resolv.conf.backup

  • Open /etc/dhcp3/dhclient.conf with your favorite text editor:


sudo nano /etc/dhcp3/dhclient.conf

  • Search for the line that starts "prepend domain-name-servers", and change it to look like this:


prepend domain-name-servers 208.67.222.222,208.67.220.220;

208.67.222.222 and 208.67.220.220 are OpenDNS DNS servers. If you wish to use your ISP's DNS servers, use them here instead of the OpenDNS servers.


Restart networking



sudo /etc/init.d/networking restart

Once this is finished, your client will now have access to the internet via ICS. Please direct any questions/comments to the Internet Connection Sharing Documentation thread.




A beginner's working example of a Ubuntu Desktop with 2 nic cards, sharing internet connection [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


Advanced Gateway Configuration



The above example outlines how to do basic ICS on a static IP network. Once you have configured your Ubuntu computers for ICS and confirmed that everything works across your static network, there are a few advanced routing configurations which can make it much easier to set up the ICS client.

Advanced configurations include DHCP server, and DNS server. A DHCP server allows the client to get an ip address automatically without having to manually configure a static IP. A DNS server allows the client to resolve internet host names without manually configuring DNS addresses.


DHCP/DNS server



This is deceptively easy, and will be acceptable for most situations. However, it will not allow the ICS client to see computers on different subnets.

  • Install software


sudo aptitude install dnsmasq

  • Stop the server


After dnsmasq has been installed, it is automatically started, so it will need to be stopped before changes can be made. sudo /etc/init.d/dnsmasq stop

  • Make a backup of the well commented configuration file (we won't use any of this, but it's handy to have a copy of for reference later)


sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf-backup

  • Edit /etc/dnsmasq.conf with your favorite text editor and add the following two lines:


interface=eth1
dhcp-range=192.168.0.100,192.168.0.250,72h

Note: The "interface" should match the interface that your clients are connected to, and the "dhcp-range" should be within the gateway's private IP subnet you configured according to the "Gateway set up" directions above.

  • Start the DHCP/DNS server


sudo /etc/init.d/dnsmasq start

Now your clients should be able to pull an automatic ip address and resolve host names.


Other approaches



The following section includes a rough outline of some alternative methods for configuring an ICS gateway. They are incomplete and untested. They are included simply for the sake of information.


Alternate server software (CLI)



There are other ways to host ICS, but they are outside the scope of this article.


Alternate NAT



The ipmasq daemon does NAT routing so you don't have to configure iptables. The following directions are incomplete and should not be considered a full description of what needs to be done to configure ipmasq.

sudo aptitude install ipmasq

Configure ipmasq to allow dhcp requests, otherwise you need to stop ipmasq to make a connection. You need to copy a .rul from the documentation directory into the /etc config and edit the interface name. Then reconfigure ipmasq to start after networking has been started

sudo dpkg-reconfigure ipmasq.


Dedicated DHCP server



dhcp3 is an easy to configure and scalable true DHCP server that can be configured for many different aplications. dhcp3 configuration is more complex, but it can be useful in many situations:

[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


Dedicated DNS server



BIND9 is a popular and well supported local DNS server. It is very versatile, and very powerful, but difficult to configure correctly:

[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


Alternate gateway software (GUI)



Another approach --- set up Firestarter, to run connection sharing, set up dhcp3-server, and set its configuration to listen to the correct eth*. To change this later, run sudo dpkg-reconfigure dhcp3-server.

Basically, you need to have Firestarter active/turned on/protecting, to have the connection shared.

When you install dhcp3-server, it will place a sample config file in your /etc/dhcp3 folder, called dhcpd.conf. I suggest you install dhcp3-server first, and then firestarter, cause if you are lucky, firestarter will set up a new config file for dhcp3 for you.

At any time that changes are made to your dhcpd.conf file, restart the server - sudo /etc/init.d/dhcp3-server restart will do it. Alternatively, every time you run the sudo dpkg-reconfigure dhcp3-server, at the end, your server will restart.

There are several issues that I had...first of all, the Firestarter firewall won't even start if you don't have it configured to listen to the right interface...You can change which one it listens to in Preferences --> Network Settings. The Local network connected device must be the same as you have dhcp3-server listening to, of course, both checkboxes under that need to be checked. The Internet connected network device will be the one that is configured for Internet. Now, I have two NICs, but I have pppoe configured on eth0, and I have Internet connection sharing configured on the same one, cause eth0 is also configured for a static 192.168 internal IP for my internal network.


simple iptables example



simple example wlan0 has the internet connection eth0 is being used to share the connection it could be directly with a single pc via a crossover cable or switch or you could have a router with a cable from eth0 to the wan port and a whole lan setup behind this. Interestingly the internet connection could be ppp0 a 3g or mobile Internet modem.



  • #!/bin/sh
    #
    # internet connection sharing wlan0 is the gate way
    # eth0 is the lan port this might use a straight ethernet cable to a router wan port or a switch or a single PC
    # 192.168.2.2 is the port that is being used by the lan for access I changed it to 192.168.2.254 and set fixed addresses for the wan and router
    #
    # change wlan0 to ppp0 and you can use this for mobile broadband connection sharing
    #
    ifconfig eth0 up"
    ifconfig eth0 192.168.2.1
    echo “1” > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.2.0/24 -j MASQUERADE
    iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 3074 -j DNAT --to-destination 192.168.2.2
    iptables -t nat -A PREROUTING -i wlan0 -p udp -m multiport --dports 88,3074 -j DNAT --to-destination 192.168.2.2
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p tcp --dport 3074 -j ACCEPT
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p udp -m multiport --dports 88,3074 -j ACCEPT


You could use the above as a bash script changing things to suit


  • If things go wrong The Following script should save you if things get badly messed up.







  • #!/bin/sh
    #
    # rc.flush-iptables - Resets iptables to default values.
    #
    # Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet>
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; version 2 of the License.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program or from the site that you downloaded it
    # from; if not, write to the Free Software Foundation, Inc., 59 Temple
    # Place, Suite 330, Boston, MA 02111-1307 USA
    #
    # Configurations
    #
    IPTABLES="/usr/sbin/iptables"
    #
    # reset the default policies in the filter table.
    #
    $IPTABLES -P INPUT ACCEPT
    $IPTABLES -P FORWARD ACCEPT
    $IPTABLES -P OUTPUT ACCEPT
    #
    # reset the default policies in the nat table.
    #
    $IPTABLES -t nat -P PREROUTING ACCEPT
    $IPTABLES -t nat -P POSTROUTING ACCEPT
    $IPTABLES -t nat -P OUTPUT ACCEPT
    #
    # reset the default policies in the mangle table.
    #
    $IPTABLES -t mangle -P PREROUTING ACCEPT
    $IPTABLES -t mangle -P POSTROUTING ACCEPT
    $IPTABLES -t mangle -P INPUT ACCEPT
    $IPTABLES -t mangle -P OUTPUT ACCEPT
    $IPTABLES -t mangle -P FORWARD ACCEPT
    #
    # flush all the rules in the filter and nat tables.
    #
    $IPTABLES -F
    $IPTABLES -t nat -F
    $IPTABLES -t mangle -F
    #
    # erase all chains that's not default in filter and nat table.
    #
    $IPTABLES -X
    $IPTABLES -t nat -X
    $IPTABLES -t mangle -X


Further reading [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]

Internet Connection Sharing Documentation thread [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


See also





  • WifiDocs/ShareEthernetConnectionThroughWireless


  • InternetHowto

موضوع رقم… 1731 -*- مساهمة رقم… 4829

 

 
توقيع العضو Admin

ஐ◄█ https://arab.forumburkina.com/ ░█►ஐ

Review https://arab.forumburkina.com// on alexa.com
 
http://www.smwak.com الرجوع الى أعلى الصفحة اذهب الى الأسفلمنتدى الشبكة العربية
Admin
1
1
Admin

عدد الرسائل : 3215
نقاط التقييم : 89210
المهنة : أستاذ جامعى
مقياس النشاط
حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Left_bar_bleue90 / 10090 / 100حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Right_bar_bleue

100

^ : ^

تكريم الأعضاء -

حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت 3h5910



حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Empty
مُساهمةموضوع: رد: حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت  حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Icon_minitime2011-03-26, 13:41أنت الرقيب على نفسك

المصدر :- منتدى الشبكة العربية
إضافة تقييم للموضوعالكاتب :- Admin
 
ترجة للمقال

حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت


Introduction مقدمة



Internet Connection Sharing (ICS) provides the ability for one computer to share its Internet connection with another computer. مشاركة اتصال إنترنت (المركز) يوفر القدرة لجهاز كمبيوتر واحد لتقاسم اتصال إنترنت الخاص به مع كمبيوتر آخر. To do this, a computer with an Internet connection must be configured to function as an Internet gateway. للقيام بذلك ، يجب تكوين جهاز كمبيوتر مع اتصال الإنترنت لتعمل بمثابة بوابة الإنترنت. A second computer (or network of computers) connects to the Internet indirectly via the gateway computer. كمبيوتر الثانية (أو شبكة من أجهزة الكمبيوتر) يتصل بالإنترنت بشكل غير مباشر عن طريق الكمبيوتر عبارة.

Situations in which ICS may be necessary include: الحالات التي قد يكون من الضروري المركز ما يلي :


  • dial up connection اتصال هاتفي
  • authenticated (PPPoA/E) connection مصادقة (PPPoA / ه) الاتصال
  • wireless connection اتصال لاسلكي
  • When it is impractical (such as with distance) to run multiple network cables to each computer. عندما يكون غير عملي (مثل مع المسافة) لتشغيل شبكة الكابلات متعددة إلى كل كمبيوتر.




GUI Method via Network Manager (Ubuntu 9.10 and up) واجهة المستخدم الرسومية عبر أسلوب إدارة شبكة الاتصال (أوبونتو 9.10 وما فوق)



In order to share an Internet connection, the computer that will do the sharing must have two network cards or ports. من أجل مشاركة اتصال إنترنت ، جهاز الكمبيوتر الذي سوف لا يجب أن يكون تبادل بطاقات الشبكة اثنين أو الموانئ. This assumes that you are using at least one Ethernet port and that it is identified as "eth0". هذا يفترض أن كنت تستخدم واحدة على الأقل إيثرنت الميناء والتي تم تحديدها بأنها "eth0". eth0 will be the port that other computers will connect to you on. وسوف يكون المنفذ eth0 أن أجهزة الكمبيوتر الأخرى وسوف تواصل لد***ك.

When you are logged in: عندما قمت بتسجيل الد*** :


  • Go to "System" on your top bar الذهاب إلى "النظام" على شريط الأعلى
  • Navigate to "Preferences" and select "Network Connections" انتقل إلى "تفضيلات" وحدد "اتصالات شبكة الاتصال"
  • When that window opens, select "Auto eth0" and press "Edit" (This assumes that you are connected to the internet on some other port, for ex. wlan0 using wireless) عندما تفتح هذه النافذة ، حدد "تلقائي eth0" ثم اضغط على "تحرير" (وهذا يفترض أن تكون متصلا بإنترنت على بعض الموانئ الأخرى ، لالسابقين. wlan0 باستخدام اللاسلكي)



A new window will open. سوف تفتح نافذة جديدة. Navigate to the tab titled "IPv4 Settings" and change the Method to "Shared to other computers". انتقل إلى علامة التبويب التي بعنوان "IPv4 إعدادات" وتغيير طريقة ل"المشتركة للحاسبات الأخرى". After restarting the computer you should now be able to plug in any computer into your other Ethernet port or share through your wireless card. بعد إعادة تشغيل الكمبيوتر الآن يجب أن تكون قادرة على سد العجز في أي جهاز كمبيوتر بمنفذ إيثرنت الخاص بك أو غيرها من الأسهم عن طريق البطاقة اللاسلكية الخاصة بك.

Note: To clarify the above example here is an example configuration that will work - ملاحظة : لتوضيح المثال أعلاه هنا هو تكوين سبيل المثال التي ستعمل --


  • You are already connected to the internet using your wireless on port wlan0 أنت متصل بالفعل إلى الإنترنت اللاسلكي الخاص به على المنفذ wlan0
  • The ethernet port eth0 is connected to the PC that needs to share your internet connection (or you could wire eth0 to a router for multiple machines) يتم توصيل منفذ إيثرنت eth0 إلى جهاز الكمبيوتر الذي يحتاج إلى مشاركة اتصال الإنترنت الخاص بك (أو هل يمكن أن الأسلاك eth0 إلى جهاز توجيه لآلات متعددة)



Note: in the case of connecting a router, especially one with wireless, where you want the users to share your connection: ملاحظة : في حالة توصيل جهاز التوجيه ، واحدة خاصة مع لاسلكية ، حيث تريد للمستخدمين مشاركة الاتصال :




  • Check before you start (in Synaptic or with dpkg-query -l dnsmasq*) that dnsmasq-base is installed and that dnsmasq is not installed. الاختيار قبل البدء (في متشابك مع تهيئة الحزم ، أو استعلام ل dnsmasq *) أن يتم تثبيت قاعدة dnsmasq والتي تم تركيبها dnsmasq ليست كذلك. Install or uninstall as appropriate (see next section). تثبيت أو إلغاء تثبيت حسب الاقتضاء (انظر القسم التالي).
  • After connecting the router, to enable masquerading, type: sudo iptables -t nat -A POSTROUTING -j MASQUERADE بعد الاتصال جهاز التوجيه ، لتمكين التنكر ، اكتب : سودو إيبتبلس تي نات حفلة تنكرية POSTROUTING - ي




Wireless Ad-Hoc connection sharing scenario اتصال لاسلكي المخصص تقاسم الإعلان السيناريو



Step by step guide: خطوة تلو الدليل :


  • dnsmasq-base has to be installed: sudo apt-get install dnsmasq-base dnsmasq قاعدة يجب أن تكون مثبتة : سودو الرابطة بين الحصول على تثبيت قاعدة dnsmasq


  • remove dnsmasq as it's conflicting with NetworkManager : sudo apt-get remove dnsmasq إزالة dnsmasq كما انها تتعارض مع NetworkManager : سودو الرابطة بين الحصول على إزالة dnsmasq


  • restart NetworkManager : sudo /etc/init.d/network-manager restart إعادة تشغيل NetworkManager : سودو / init.d الخ / / مدير شبكة إعادة تشغيل


  • Add a new wireless network with NetworkManager (left-click on NetworkManager icon, then select "Create New Wireless Network") إضافة شبكة لاسلكية جديدة مع NetworkManager (اليسار انقر على NetworkManager الرمز ، ثم حدد "إنشاء شبكة لاسلكية جديدة")


  • Call the new network " UbuntuAdhoc " (note: if you choose another name you will have to turn on connection sharing later by editing the network you just created!) استدعاء شبكة جديدة " UbuntuAdhoc "(ملاحظة : إذا اخترت اسم آخر سيكون لديك لتشغيل مشاركة اتصال في وقت لاحق عن طريق تحرير شبكة أنشأته للتو!)


  • Set encryption to "WEP40..." تعيين التشفير ل"WEP40..." (note: you may have to experiment here according to what type of encryption with ad-hoc the phone/other laptop/pc supports, wpa is not supported ) (ملاحظة : قد يكون لهذه التجربة هنا وفقا لنوع التشفير مع مخصصة الهاتف / المحمول الأخرى / يدعم أجهزة الكمبيوتر ، وبا ليست معتمدة)



NetworkManager now should connect to itself (which means it creates the ad-hoc wireless network and routes any internet traffic to your wired network interface). NetworkManager الآن يجب أن تواصل لنفسها (وهو ما يعني أنه يخلق إلى شبكة لاسلكية مخصصة الإعلانية وطرق أي الحركة على شبكة الانترنت السلكية واجهة الشبكة). Now connect with the client(s) and you should have a working internet connection. تواصل الآن مع العميل (ق) ويجب أن يكون وصلة انترنت عاملة.


Ubuntu Internet Gateway Method (iptables) منتديات الإنترنت عبارة الأسلوب (إيبتبلس)



You will need two network cards in the gateway computer, or a PPP interface and a network card. وسوف تحتاج إلى اثنين من بطاقات الشبكة في الكمبيوتر عبارة ، أو واجهة حزب الشعب الباكستاني وبطاقة الشبكة. One network card (or PPP interface) connects to the internet, we will call this card eth0 . شبكة بطاقة واحدة (حزب الشعب الباكستاني أو واجهة) يربط إلى الإنترنت ، ونحن ندعو هذا بطاقة eth0. The other card connects to your internal network, we will call this eth1 . البطاقة الأخرى يتصل شبكة الاتصال الداخلية الخاصة بك ، فإننا سوف ندعو هذه eth1. It is also possible to do ICS with a single network card. ومن الممكن أيضا للقيام المركز مع بطاقة شبكة واحدة. In this case, use eth0 for the internet and eth0:0 for the internal network. في هذه الحالة ، استخدم eth0 للإنترنت وeth0 : 0 لشبكة الاتصال الداخلية.




  • Internet <<==>> eth0 <> Ubuntu gateway <> eth1 <<==>> Client PC الإنترنت <<==>>eth0 <بوابة أوبونتو> <eth1 <<==>>عميل جهاز كمبيوتر


  • Internet <<==>> ppp0 <> Ubuntu gateway <> eth1 <<==>> Client PC الإنترنت <<==>>ppp0 <بوابة أوبونتو> <eth1 <<==>>عميل جهاز كمبيوتر


  • Internet <<==>> eth0 <> Ubuntu gateway <> eth0:0 <<==>> Client PC الإنترنت <<==>>eth0 <أوبونتو بوابة <eth0 : 0 <<==>>عميل جهاز كمبيوتر




Gateway set up مجموعة بوابة بالتسجيل



The following example will focus on the most common gateway setup; an Ubuntu computer with two wired network adapters (eth0 and eth1) hosting ICS to a static internal network configured for the 192.168.0.x subnet. المثال التالي سوف يركز على إعداد العبارة الأكثر شيوعا ، مع اثنين من محولات الشبكة السلكية (eth0 و eth1) استضافة المركز لشبكة داخلية ثابتة تكوين للشبكة الفرعية 192.168.0.x كمبيوتر أوبونتو.

For this example, eth0 is used to represent the network card connected to the internet and eth1 represents the network card connected to a client PC. لهذا المثال ، يتم استخدام eth0 لتمثيل بطاقة شبكة متصلة بشبكة الإنترنت وeth1 يمثل بطاقة شبكة متصلة بجهاز كمبيوتر العميل. You can replace eth0 and eth1 as needed for your situation. يمكنك استبدال eth0 و eth1 حسب الحاجة من أجل الوضع الخاص بك. Also, any private IP subnet can be used for the internal network IP addresses. أيضا ، أي الشبكة الفرعية الملكية الفكرية خاصة يمكن استخدامها لعناوين الشبكة الملكية الفكرية الداخلية.

In summary: باختصار :




  • eth0 = the network adapter with internet (external or WAN). eth0 = محول شبكة الاتصال مع الإنترنت (الخارجية أو الواسعة).
    eth1 = the network adapter to which a second computer is attached (internal or LAN). التي eth1 = محول الشبكة متصلة كمبيوتر الثاني (الداخلية أو الشبكة المحلية).
    192.168.0.x = IP subnet for eth1 192.168.0.x الشبكة الفرعية للملكية الفكرية = eth1



Your setup may be different. الإعداد الخاص بك قد تكون مختلفة. If so, make sure to change them accordingly in the following commands. إذا كان الأمر كذلك ، تأكد من تغيير وفقا لذلك في الأوامر التالية.


Configure internal network card تكوين بطاقة شبكة الاتصال الداخلية



Configure your internal network card (eth1) for static IP like so: sudo ifconfig eth1 192.168.0.1 تكوين بطاقة الشبكة الداخلية (eth1) للملكية الفكرية ساكنة مثل ذلك : سودو ifconfig eth1 192.168.0.1

(The external and internal network cards cannot be on the same subnet) (ويمكن للبطاقات الشبكة الخارجية والداخلية لا يكون على نفس الشبكة الفرعية)
Configure NAT تكوين نات



Configure iptables for NAT translation so packets can be correctly routed through the Ubuntu gateway. إيبتبلس تكوين للترجمة نات بحيث يمكن توجيه الحزم بشكل صحيح من خلال عبارة أوبونتو. sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT سودو إيبتبلس ألف الأمام يا eth0 eth1 - ط ق conntrack 192.168.0.0/24 م -- ctstate تقبل الجديد ي
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT سودو إيبتبلس وconntrack الأمام م -- تأسست ctstate ، وتقبل المتصلة ي
sudo iptables -A POSTROUTING -t nat -j MASQUERADE إيبتبلس سودو - حفلة تنكرية POSTROUTING تي ي نات

(rule1 allows forwarded packets (initial ones), rule2 allows forwarding of established connection packets (and those related to ones that started), rule3 does the NAT.) (يسمح rule1 توجيه الحزم (منها الأولي) ، rule2 يسمح إعادة توجيه الحزم اتصال ثابتة (وتلك المتصلة التي بدأت منها) ، rule3 هل نات).

IPtables settings need to be set-up at each boot (they are not saved automatically), with the following commands: إيبتبلس الإعدادات تحتاج إلى تعيين المتابعة في كل التمهيد (لم يتم حفظها تلقائيا) ، مع الأوامر التالية :


  • Save the iptables: حفظ إيبتبلس :



sudo iptables-save | sudo tee /etc/iptables.sav إيبتبلس سودو - حفظ | المحمله سودو / الخ / iptables.sav


  • Edit /etc/rc.local and add the following lines before the "exit 0" line: تحرير / الخ / rc.local وإضافة الأسطر التالية قبل السطر "إنهاء 0" :



iptables-restore < /etc/iptables.sav [إيبتبلس استعادة </ الخ / iptables.sav


Enable routing تمكين التوجيه




  • Configure the gateway for routing between two interfaces by enabling IP forwarding: تكوين العبارة لتوجيه بين واجهات اثنين من توجيه تمكين الملكية الفكرية :



sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" سودو ش ، ج "صدى 1> / proc/sys/net/ipv4/ip_forward"




  • Edit /etc/sysctl.conf and add these lines: تحرير / الخ / sysctl.conf وإضافة هذه الأسطر :



net.ipv4.conf.default.forwarding=1 net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.all.forwarding=1 net.ipv4.conf.all.forwarding = 1

The /etc/sysctl.conf edit is required because of following Bug (Hardy and later releases) Launchpad Bug Report / sysctl.conf تحرير مطلوب / الخ بسبب الأخطاء التالية (هاردي والإصدارات الأحدث) انطلاق علة تقرير


Client set up تعيين العميل بالتسجيل



Any OS can connect to the internet as an ICS client as long as networking has been configured correctly. ويمكن لأي نظام التشغيل للاتصال بالإنترنت كعميل المركز كما تم تكوين دام التواصل بشكل صحيح. The following example will focus on how to set up an Ubuntu ICS client. المثال التالي سوف يركز على كيفية إعداد عميل المركز أوبونتو. For this example, it is assumed that the client is connected to an Ubuntu gateway which has been configured to share ICS on the 192.168.0.x subnet according to the gateway set up outlined above. على سبيل المثال هذا ، ومن المفترض أن يتم توصيل العميل إلى عبارة أوبونتو التي تم تكوينها لحصة المركز على الشبكة الفرعية 192.168.0.x وفقا لمجموعة بوابة المبينة في أعلاه.

For this example, eth0 is the network card on the client which is connected (by crossover cable) to eth1 on the Ubuntu gateway. على سبيل المثال هذا ، eth0 هو بطاقة الشبكة على العميل الذي يتصل (عن طريق الكابل كروس) لeth1 على بوابة أوبونتو. You can replace eth0 as needed for your situation. يمكنك استبدال eth0 حسب الحاجة من أجل الوضع الخاص بك. Also, any private IP subnet can be used for the internal network IP address, as long as it matches the subnet on the gateway. أيضا ، يمكن استخدام أي شبكة فرعية خاصة الملكية الفكرية من أجل عنوان شبكة الملكية الفكرية الداخلية ، طالما أنها تتوافق مع الشبكة الفرعية على العبارة.
Disable networking تعطيل الشبكات



sudo /etc/init.d/networking stop سودو / / init.d وقف الشبكات الخ /


Give the client a static IP address تعطي العميل ساكنة معالجة الملكية الفكرية



sudo ifconfig eth0 192.168.0.100 ifconfig eth0 192.168.0.100 سودو

This IP address can be anything within the gateway's private IP range. يمكن أن يحدث هذا عنوان بروتوكول الإنترنت أن يكون أي شيء داخل نطاق العبارة الملكية الفكرية الخاصة.
Configure routing تكوين التوجيه



sudo route add default gw 192.168.0.1 الطريق سودو إضافة غيغاواط الافتراضية 192.168.0.1

This address should match the IP address on the gateway's internal network card (eth1 in the above example). وينبغي لهذا العنوان يتطابق مع عنوان بروتوكول الإنترنت على بطاقة بوابة شبكة الاتصال الداخلية (eth1 في المثال أعلاه).
Configure DNS servers تكوين دياناس



Unless your ICS gateway can also perform DNS , you must manually configure the client with your ISP DNS servers. ما لم الخاص بوابة المركز يمكن أيضا تنفيذ نظام أسماء النطاقات ، يجب عليك يدويا تكوين العميل مع مقدمي خدمات الإنترنت خدمة نظام أسماء النطاقات الخاصة بك. If you do not know your ISP's DNS servers, you can use OpenDNS servers instead. إذا كنت لا تعرف مزود خدمة الإنترنت في خدمة نظام أسماء النطاقات ، يمكنك استخدام ملقمات أبندنس بدلا من ذلك.


  • Backup your current /etc/resolve.conf file: النسخ الاحتياطي الحالي الخاص بك / الخ / ملف resolve.conf :



sudo cp /etc/resolv.conf /etc/resolv.conf.backup سودو القطري / الخ / resolv.conf / الخ / resolv.conf.backup


  • Open /etc/dhcp3/dhclient.conf with your favorite text editor: فتح / etc/dhcp3/dhclient.conf مع محرر النصوص المفضل لديك :



sudo nano /etc/dhcp3/dhclient.conf نانو سودو / etc/dhcp3/dhclient.conf


  • Search for the line that starts "prepend domain-name-servers", and change it to look like this: البحث عن السطر الذي يبدأ "يضيف على البداية المجال اسم ملقمات" ، وتغييره لتبدو مثل هذا :



prepend domain-name-servers 208.67.222.222,208.67.220.220; يضيف على البداية المجال اسم ملقمات 208.67.222.222،208.67.220.220 ؛

208.67.222.222 and 208.67.220.220 are OpenDNS DNS servers. 208.67.222.222 208.67.220.220 ويتم أبندنس دياناس. If you wish to use your ISP's DNS servers, use them here instead of the OpenDNS servers. إذا كنت ترغب في استخدام خدمات الانترنت الخاص دياناس ، واستخدامها هنا بدلا من الملقمات أبندنس.


Restart networking إعادة تشغيل الشبكات



sudo /etc/init.d/networking restart سودو / الخ / init.d / إعادة تشغيل الشبكات

Once this is finished, your client will now have access to the internet via ICS. بمجرد الانتهاء من ذلك ، سوف العميل لديك الآن الوصول إلى الإنترنت عن طريق المركز. Please direct any questions/comments to the Internet Connection Sharing Documentation thread. يرجى توجيه أي أسئلة / تعليقات إلى الاتصال بإنترنت الوثائق الموضوع.







A beginner's working example of a Ubuntu Desktop with 2 nic cards, sharing internet connection [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] المبتدئين المثال العملي لسطح المكتب مع أوبونتو 2 بطاقات شركة الاستثمارات الوطنية ، وتقاسم الاتصال بالإنترنت [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


Advanced Gateway Configuration المتقدمة تكوين العبارة



The above example outlines how to do basic ICS on a static IP network. المثال أعلاه توضح كيفية القيام المركز الأساسية على شبكة الملكية الفكرية ثابت. Once you have configured your Ubuntu computers for ICS and confirmed that everything works across your static network, there are a few advanced routing configurations which can make it much easier to set up the ICS client. وبمجرد الانتهاء من تكوين أجهزة الكمبيوتر أوبونتو عن المركز ، وأكد ان كل شيء يعمل عبر الشبكة الثابتة ، وهناك عدد قليل المتقدمة تكوينات التوجيه الذي يمكن أن يجعل من الاسهل بكثير ان انشاء المركز العميل.

Advanced configurations include DHCP server, and DNS server. تكوينات متقدمة تشمل دتب الخادم ، والخادم نظام أسماء النطاقات. A DHCP server allows the client to get an ip address automatically without having to manually configure a static IP. خادم دتب تسمح للعميل للحصول على عنوان بروتوكول الإنترنت تلقائيا دون الحاجة إلى تكوين يدويا في الملكية الفكرية وثابت. A DNS server allows the client to resolve internet host names without manually configuring DNS addresses. ملقم نظام أسماء النطاقات التي تسمح للعميل حل أسماء المضيف الإنترنت بدون تكوين يدويا عناوين أسماء النطاقات.


DHCP/DNS server دتب أسماء النطاقات الخادم /



This is deceptively easy, and will be acceptable for most situations. هذا أمر سهل مضلل ، وسيكون مقبولا بالنسبة لمعظم الحالات. However, it will not allow the ICS client to see computers on different subnets. ومع ذلك ، فإنه لن يسمح للعميل المركز لرؤية أجهزة الكمبيوتر على الشبكات الفرعية المختلفة.


  • Install software تركيب البرمجيات



sudo aptitude install dnsmasq الموهبه سودو تثبيت dnsmasq


  • Stop the server إيقاف ملقم



After dnsmasq has been installed, it is automatically started, so it will need to be stopped before changes can be made. بعد تثبيت dnsmasq ، يتم تشغيل تلقائيا ، لذلك فإنه سيكون في حاجة إلى أن تتوقف قبل أن تتمكن من إجراء التغييرات. sudo /etc/init.d/dnsmasq stop سودو / / init.d الخ / وقف dnsmasq


  • Make a backup of the well commented configuration file (we won't use any of this, but it's handy to have a copy of for reference later) إجراء نسخة احتياطية من ملف التكوين جيدا وعلق (ونحن لن تستخدم أي شيء من هذا ، لكنه مفيد في الحصول على نسخة من كمرجع لاحق)



sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf-backup سودو القطري / الخ / dnsmasq.conf / الخ / dnsmasq.conf - احتياطية


  • Edit /etc/dnsmasq.conf with your favorite text editor and add the following two lines: تحرير / الخ / dnsmasq.conf مع محرر النصوص المفضل لديك وإضافة السطرين التاليين :



interface=eth1 واجهة = eth1
dhcp-range=192.168.0.100,192.168.0.250,72h دتب المدى = ح 192.168.0.100،192.168.0.250،72

Note: The "interface" should match the interface that your clients are connected to, and the "dhcp-range" should be within the gateway's private IP subnet you configured according to the "Gateway set up" directions above. ملاحظة : "واجهة" يجب أن تطابق واجهة التي ترتبط إلى زبائنك ، و "دتب المدى" يجب أن يكون ضمن الشبكة الفرعية العبارة الملكية الفكرية الخاصة التي تم تكوينها وفقا "لاقامة بوابة" الاتجاهات المذكورة أعلاه.


  • Start the DHCP/DNS server بدء تشغيل نظام أسماء النطاقات خادم دتب /



sudo /etc/init.d/dnsmasq start سودو / / init.d الخ / بدء dnsmasq

Now your clients should be able to pull an automatic ip address and resolve host names. الآن يجب أن زبائنك تكون قادرة على سحب عنوان الملكية الفكرية وآلية حل أسماء المضيف.


Other approaches غيرها من النهج



The following section includes a rough outline of some alternative methods for configuring an ICS gateway. المقطع التالي يتضمن الخطوط العريضة الخام من بعض وسائل بديلة لتكوين عبارة المركز. They are incomplete and untested. فهي غير مكتملة وغير مجربة. They are included simply for the sake of information. وهي مدرجة ببساطة من أجل المعلومات.


Alternate server software (CLI) برنامج الخادم البديل (المبادرة القطرية)



There are other ways to host ICS, but they are outside the scope of this article. هناك طرق أخرى لاستضافة المركز ، لكنها خارج نطاق هذا المقال.


Alternate NAT البديل نات



The ipmasq daemon does NAT routing so you don't have to configure iptables. البرنامج الخفي لا ipmasq التوجيه نات ذلك لم يكن لديك لتكوين إيبتبلس. The following directions are incomplete and should not be considered a full description of what needs to be done to configure ipmasq. الاتجاهات التالية غير مكتملة وينبغي ألا يعتبر وصفا كاملا لما يجب القيام به لتكوين ipmasq.

sudo aptitude install ipmasq الموهبه سودو تثبيت ipmasq

Configure ipmasq to allow dhcp requests, otherwise you need to stop ipmasq to make a connection. تكوين ipmasq للسماح لطلبات دتب ، وإلا كنت في حاجة لوقف ipmasq لإجراء اتصال. You need to copy a .rul from the documentation directory into the /etc config and edit the interface name. تحتاج إلى نسخ rul. من الدليل وثائق في التكوين الخ / وتعديل اسم واجهة. Then reconfigure ipmasq to start after networking has been started ثم تكوين ipmasq ليبدأ بعدها تم بدء تشغيل الشبكات

sudo dpkg-reconfigure ipmasq. تهيئة الحزم سودو - تكوين ipmasq.


Dedicated DHCP server خادم مخصص دتب



dhcp3 is an easy to configure and scalable true DHCP server that can be configured for many different aplications. dhcp3 هو وسيلة سهلة وقابلة لتكوين خادم دتب الحقيقية التي يمكن تكوينها من أجل ابليكاتيونس عديدة ومختلفة. dhcp3 configuration is more complex, but it can be useful in many situations: dhcp3 التكوين هو أكثر تعقيدا ، ولكنها يمكن أن تكون مفيدة في كثير من الحالات :

[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] الشبكي : / / help.ubuntu.com/community/dhcp3-server


Dedicated DNS server كرس نظام أسماء النطاقات الخادم



BIND9 is a popular and well supported local DNS server. BIND9 هو شعبية ومدعومة جيدا أسماء النطاقات الخادم المحلي. It is very versatile, and very powerful, but difficult to configure correctly: ومن شديد التنوع ، وقوية جدا ، ولكن من الصعب تكوين بشكل صحيح :

[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] الشبكي : / / help.ubuntu.com/community/BIND9ServerHowto


Alternate gateway software (GUI) البرنامج عبارة بديلة (واجهة المستخدم الرسومية)



Another approach --- set up Firestarter , to run connection sharing, set up dhcp3-server, and set its configuration to listen to the correct eth*. وثمة نهج آخر --- إعداد متميز ، لتشغيل مشاركة اتصال ، وإنشاء dhcp3 الخادم ، ومجموعة التهيئة للاستماع إلى تي إتش الصحيح *. To change this later, run sudo dpkg-reconfigure dhcp3-server. لتغيير هذا في وقت لاحق ، تشغيل سودو تهيئة الحزم ، تكوين dhcp3 الخادم.

Basically, you need to have Firestarter active/turned on/protecting, to have the connection shared. أساسا ، تحتاج إلى أن يكون متميز نشط / تشغيل / حماية ، ليكون الاتصال المشتركة.

When you install dhcp3-server, it will place a sample config file in your /etc/dhcp3 folder, called dhcpd.conf. عند تثبيت خادم dhcp3 ، فإنه سيتم وضع نموذج ملف التكوين في مجلد etc/dhcp3 / ، دعا dhcpd.conf. I suggest you install dhcp3-server first, and then firestarter, cause if you are lucky, firestarter will set up a new config file for dhcp3 for you. أقترح عليك تثبيت dhcp3 الخادم أولا ، ثم متميز ، والسبب إذا كنت محظوظا ، متميز وانشاء ملف جديد التهيئة لdhcp3 لك.

At any time that changes are made to your dhcpd.conf file, restart the server - sudo /etc/init.d/dhcp3-server restart will do it. في أي وقت أن تم إجراء تغييرات على ملف dhcpd.conf الخاص بك ، وإعادة تشغيل الخادم -- سودو / etc/init.d/dhcp3-server إعادة تشغيل وسوف نفعل ذلك. Alternatively, every time you run the sudo dpkg-reconfigure dhcp3-server, at the end, your server will restart. بدلا من ذلك ، في كل مرة تقوم بتشغيل سودو تهيئة الحزم ، تكوين dhcp3 الخادم ، في النهاية ، سوف الملقم إعادة تشغيل.

There are several issues that I had...first of all, the Firestarter firewall won't even start if you don't have it configured to listen to the right interface...You can change which one it listens to in Preferences --> Network Settings. هناك العديد من القضايا التي كان لي... بادئ ذي بدء ، فإن جدار الحماية متميز لم يبدأ حتى إذا لم يكن لديك تكوين للاستماع إلى واجهة الحق... يمكنك تغيير واحد الذي كان يستمع إليها في تفضيلات -- --> إعدادات الشبكة. The Local network connected device must be the same as you have dhcp3-server listening to, of course, both checkboxes under that need to be checked. يجب أن الشبكة المحلية توصيل الجهاز يكون نفس لديك dhcp3 خادم الاستماع الى وبطبيعة الحال ، سواء تحت خانات التي تحتاج إلى فحص. The Internet connected network device will be the one that is configured for Internet. سيقوم الجهاز الإنترنت شبكة متصلة تكون واحدة الذي تم تكوينه للإنترنت. Now, I have two NICs, but I have pppoe configured on eth0, and I have Internet connection sharing configured on the same one, cause eth0 is also configured for a static 192.168 internal IP for my internal network. الآن ، لدي اثنين من البلدان الحديثة التصنيع ، ولكن أنا على تكوين pppoe eth0 ، ولدي مشاركة اتصال إنترنت تكوينها على نفس القضية واحدة ، كما تم تكوين eth0 عن الملكية الفكرية 192،168 ثابت الداخلية لشبكة الاتصال الداخلية.


simple iptables example بسيطة إيبتبلس سبيل المثال



simple example wlan0 has the internet connection eth0 is being used to share the connection it could be directly with a single pc via a crossover cable or switch or you could have a router with a cable from eth0 to the wan port and a whole lan setup behind this. مثال بسيط wlan0 قد يتم استخدام اتصال إنترنت eth0 للمشاركة في اتصال أنها يمكن أن تكون مباشرة مع جهاز كمبيوتر واحد عن طريق كابل كروس أو التبديل أو هل يمكن أن يكون مع جهاز توجيه برقية من eth0 الى ميناء وان وإعداد الشبكة كلها وراء هذا. Interestingly the internet connection could be ppp0 a 3g or mobile Internet modem. ومن المثير للاهتمام ويمكن أن يكون الاتصال بالإنترنت ppp0 مودم 3G الإنترنت أو الهاتف المحمول.




  • #!/bin/sh #! / بن / ش
    # #
    # internet connection sharing wlan0 is the gate way # مشاركة الاتصال بإنترنت wlan0 هو السبيل بوابة
    # eth0 is the lan port this might use a straight ethernet cable to a router wan port or a switch or a single PC # eth0 هو المنفذ لان هذا قد تستخدم كابل إيثرنت مباشرة إلى منفذ وان جهاز التوجيه أو التبديل أو جهاز كمبيوتر واحد
    # 192.168.2.2 is the port that is being used by the lan for access I changed it to 192.168.2.254 and set fixed addresses for the wan and router # 192.168.2.2 هو المنفذ الذي يتم استخدامه بواسطة الشبكة المحلية للوصول أنا تغييره إلى 192.168.2.254 وتعيين عناوين ثابتة لوان والتوجيه
    # #
    # change wlan0 to ppp0 and you can use this for mobile broadband connection sharing # تغيير wlan0 إلى ppp0 ويمكنك استخدام هذا للجوال تقاسم اتصال واسع النطاق
    # #
    ifconfig eth0 up" ifconfig eth0 بالتسجيل "
    ifconfig eth0 192.168.2.1 ifconfig eth0 192.168.2.1
    echo “1” > /proc/sys/net/ipv4/ip_forward صدى "1"> / proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.2.0/24 -j MASQUERADE [إيبتبلس تي نات ألف POSTROUTING wlan0 س ، ق ، ي حفلة تنكرية 192.168.2.0/24
    iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 3074 -j DNAT --to-destination 192.168.2.2 [إيبتبلس تي نات ألف PREROUTING ط برنامج التعاون الفني wlan0 ف -- DNAT dport 3074 - ي -- إلى الوجهة 192.168.2.2
    iptables -t nat -A PREROUTING -i wlan0 -p udp -m multiport --dports 88,3074 -j DNAT --to-destination 192.168.2.2 [إيبتبلس تي نات ألف PREROUTING ط wlan0 ف udp م متعدد المنافذ -- dports DNAT 88،3074 - ي -- إلى الوجهة 192.168.2.2
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p tcp --dport 3074 -j ACCEPT [إيبتبلس وإلى الأمام أنا wlan0 مد 192.168.2.2 ف برنامج التعاون الفني -- dport اعقد 3074 - ي
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p udp -m multiport --dports 88,3074 -j ACCEPT [إيبتبلس وإلى الأمام أنا wlan0 مد متعدد المنافذ udp م 192.168.2.2 ف -- dports تقبل 88،3074 - ي



You could use the above as a bash script changing things to suit هل يمكن استخدام برنامج نصي على النحو الوارد أعلاه باش تغيير الأشياء التي تتناسب مع



  • If things go wrong The Following script should save you if things get badly messed up. اذا كانت الامور على غير ما يرام وينبغي أن يوفر لك البرنامج النصي التالي اذا سارت الامور بشكل سيء في الحصول على افسدت.









  • #!/bin/sh #! / بن / ش
    # #
    # rc.flush-iptables - Resets iptables to default values. # rc.flush - إيبتبلس -- يعيد إيبتبلس إلى القيم الافتراضية.
    # #
    # Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet> # حقوق الطبع محفوظة (جيم) Andreasson أوسكار 2001 <bluefluxATkoffeinDOTnet>
    # #
    # This program is free software; you can redistribute it and/or modify # هذا البرنامج هو برنامج حر ، بإمكانك إعادة توزيعه و / أو تعديل
    # it under the terms of the GNU General Public License as published by # تحت شروط الرخصة العمومية العامة لجنو والتي نشرتها
    # the Free Software Foundation; version 2 of the License. # مؤسسة البرمجيات الحرة ؛ 2 نسخة من رخصة.
    # #
    # This program is distributed in the hope that it will be useful, # تم توزيع هذا البرنامج على أمل أن يكون مفيدا ،
    # but WITHOUT ANY WARRANTY; without even the implied warranty of # ولكن دون أي ضمان ؛ حتى دون ضمان ضمني
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # التسويق أو الملاءمة لغرض معين. See the راجع
    # GNU General Public License for more details. # رخصة جنو العمومية لمزيد من التفاصيل.
    # #
    # You should have received a copy of the GNU General Public License # يجب أن تكون قد استلمت نسخة من رخصة جنو العمومية
    # along with this program or from the site that you downloaded it # مع هذا البرنامج أو من الموقع الذي قمت بتحميله
    # from; if not, write to the Free Software Foundation, Inc., 59 Temple # من ، وإذا لم يكن كذلك ، الكتابة إلى مؤسسة البرمجيات الحرة ، المحدودة ، 59 معبد
    # Place, Suite 330, Boston, MA 02111-1307 USA # مكان ، جناح 330 ، بوسطن ، ماجستير 02111-1307 الولايات المتحدة الأمريكية
    # #
    # Configurations # تكوينات
    # #
    IPTABLES="/usr/sbin/iptables" إيبتبلس = "/ البيرة / دليل / إيبتبلس"
    # #
    # reset the default policies in the filter table. # إعادة تعيين سياسات الافتراضية في جدول التصفية.
    # #
    $IPTABLES -P INPUT ACCEPT $ [إيبتبلس ف مستلزمات اعقد
    $IPTABLES -P FORWARD ACCEPT $ [إيبتبلس ف اعقد إلى الأمام
    $IPTABLES -P OUTPUT ACCEPT $ [إيبتبلس ف الناتج اعقد
    # #
    # reset the default policies in the nat table. # إعادة تعيين سياسات الافتراضية في الجدول نات.
    # #
    $IPTABLES -t nat -P PREROUTING ACCEPT $ [إيبتبلس تي نات ف PREROUTING اعقد
    $IPTABLES -t nat -P POSTROUTING ACCEPT $ [إيبتبلس تي نات ف POSTROUTING اعقد
    $IPTABLES -t nat -P OUTPUT ACCEPT $ [إيبتبلس تي نات ف الناتج اعقد
    # #
    # reset the default policies in the mangle table. # إعادة تعيين سياسات الافتراضية في الجدول فسد.
    # #
    $IPTABLES -t mangle -P PREROUTING ACCEPT $ [إيبتبلس تي فسد ف PREROUTING اعقد
    $IPTABLES -t mangle -P POSTROUTING ACCEPT $ [إيبتبلس تي فسد ف POSTROUTING اعقد
    $IPTABLES -t mangle -P INPUT ACCEPT $ [إيبتبلس تي فسد ف مستلزمات اعقد
    $IPTABLES -t mangle -P OUTPUT ACCEPT $ [إيبتبلس تي فسد ف الناتج اعقد
    $IPTABLES -t mangle -P FORWARD ACCEPT $ [إيبتبلس تي فسد ف اعقد إلى الأمام
    # #
    # flush all the rules in the filter and nat tables. # طرد جميع القواعد الواردة في الجداول تصفية ونات.
    # #
    $IPTABLES -F $ [إيبتبلس واو
    $IPTABLES -t nat -F $ [إيبتبلس تي إف نات
    $IPTABLES -t mangle -F $ [إيبتبلس فسد تي إف
    # #
    # erase all chains that's not default in filter and nat table. # محو كل السلاسل التي ليست في الجدول الافتراضي مرشح وطني.
    # #
    $IPTABLES -X $ [إيبتبلس العاشر
    $IPTABLES -t nat -X $ [إيبتبلس تي نات العاشر
    $IPTABLES -t mangle -X $ [إيبتبلس تي فسد العاشر



Further reading [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] مزيد من القراءة الشبكي : / help.ubuntu.com / / المجتمع / IptablesHowTo

Internet Connection Sharing Documentation thread [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط] اتصال بإنترنت الوثائق موضوع [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


See also انظر أيضا






  • WifiDocs/ShareEthernetConnectionThroughWireless WifiDocs / ShareEthernetConnectionThroughWireless


  • InternetHowto InternetHowto

موضوع رقم… 1731 -*- مساهمة رقم… 4830

 

 
توقيع العضو Admin

ஐ◄█ https://arab.forumburkina.com/ ░█►ஐ

Review https://arab.forumburkina.com// on alexa.com
 
http://www.smwak.com الرجوع الى أعلى الصفحة اذهب الى الأسفلمنتدى الشبكة العربية
{احلاهم واتحداهم}
9
9
{احلاهم واتحداهم}

عدد الرسائل : 401
نقاط التقييم : 15609
مقياس النشاط
حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Left_bar_bleue40 / 10040 / 100حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Right_bar_bleue

100

^ : ^

تكريم الأعضاء -

حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Hart210



حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Empty
مُساهمةموضوع: رد: حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت  حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت Icon_minitime2011-08-11, 00:28أنت الرقيب على نفسك

المصدر :- منتدى الشبكة العربية
إضافة تقييم للموضوعالكاتب :- {احلاهم واتحداهم}
 
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذه الصورة]

رووعه الموضوع

تسلم يدينك (يمناك)

ماشاء الله عليك

موضوع رقم… 1731 -*- مساهمة رقم… 19385

 

 
توقيع العضو {احلاهم واتحداهم}

ஐ◄█ https://arab.forumburkina.com/ ░█►ஐ

Review https://arab.forumburkina.com// on alexa.com
 
الرجوع الى أعلى الصفحة اذهب الى الأسفلمنتدى الشبكة العربية
 

حل مشكلة شبكة الأتصال فى مشاركة أتصال الأنترنت

استعرض الموضوع التالياستعرض الموضوع السابقالرجوع الى أعلى الصفحة
صفحة 1 من اصل 1

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
الشبكة العربية ::  منتديات الكومبيوتر والأنترنت والموبيل :: منتدى برامج إدارة الشبكات وتوزيعات الأنترنت-
©phpBB | الحصول على منتدى مجاني | منتدى مجاني للدعم و المساعدة | التبليغ عن محتوى مخالف | آخر المواضيع
الشبكة العربية