I use Ubuntu 14. I have two interfaces (eth0 and usb0) and two connections with manual settings. I want to use network manager. Eth0 is WAN. How can I create shared connection to other computers? If I create new connection (third one) and use eth0 as interface then it doesn't work. If I open existing connection (eth0) and change method from Manual to Shared to other computers then all my settings disappear.
|
|
||||
|
|
|
To do it through network manager using gui dnsmasq-base has to be installed:
Remove dnsmasq because it conflicts with NetworkManager:
NetworkManager version 0.7, shipped with Ubuntu 8.10 and later, contains a redesigned user interface for managing network connections. Among the new features and UI is an option to make a connection “Shared to other computers”. This is basically a dead-simple NAT (Network Address Translation), or Internet connection sharing, built right in to NetworkManager. To enable this, you must follow three steps: Install dnsmasq on your computer. (On Ubuntu, you will want to install the Make sure your WAN connection (i.e. Internet-connected connection) is all configured (e.g. with DHCP or a static address) and working. Basically, make sure you can pull up web pages. For your LAN interface (which might be a second network card or a wireless card), select “Shared to other computers” in the IPv4 Settings tab. If everything works right, NetworkManager should have auto-configured a subnet and DHCP server on your LAN interface, and is ready for sharing your Internet connection. To do it through terminal It's very simple to masquerade (internet connection sharing in Windows language ) on Linux with a few lines of iptables and ip_forward commands. First of all you have to flush and delete existing firewall rules. So flush rules by typing in terminal:
Now delete these chains:
Now it's time to save the iptables rules so type:
Now all rules and chains have been cleared! Check it in /etc/sysconfig/iptables which has all default rules set to accept. Now open /etc/rc.d/rc.local and insert the line:
And then save and close the file. Now asuming that your internet interface is eth0, type:
Note: check if iptables is set to start during boot up. Or check the status of your iptables service:
If level 5 is on then it's ok othewise start the service at level 5 or level 2345. Citation: https://jeremy.visser.name/2009/03/simple-internet-connection-sharing-with-networkmanager/ https://www.howtoforge.com/internet-connection-sharing-masquerading-on-linux |
|||||||||||||||||||||
|
