mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #2662 from ictlyh/master
[Translating] tech/20150423 How to Change Default Web Browser and Email Client In Ubuntu
This commit is contained in:
commit
8ff35d42a2
@ -1,75 +0,0 @@
|
|||||||
How IP forwarding Helps Connecting Private interface to Internet in Linux
|
|
||||||
================================================================================
|
|
||||||
Hi everyone, today we'll learn about IP forwarding or Packet forwarding from one network interface to another in Linux using iptables. IP forwarding is a concept to make Linux machine to send data from one network to another as a router. So, it can be used as a **router** or a proxy server that can share internet or network connection from one connection to multiple client machines.
|
|
||||||
|
|
||||||
Here are some easy steps to enable IP Forwarding or Network packets forwarding method.
|
|
||||||
|
|
||||||
### 1. Enabling IPv4 Forwarding ###
|
|
||||||
|
|
||||||
First of all, we'll gonna enable IPv4 forwarding in our Linux Operating System. To do that, we'll need to execute the following command in a shell or a terminal under sudo mode.
|
|
||||||
|
|
||||||
$ sudo -s
|
|
||||||
|
|
||||||
# echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
||||||
|
|
||||||
![Temporary IP Forwarding](http://blog.linoxide.com/wp-content/uploads/2015/03/ip-forward-temporary.png)
|
|
||||||
|
|
||||||
**Note: the above command is enables ip forwarding instantly and temporarily until the next reboot. To enable it permanently, we'll need to open /etc/sysctl.conf using our favorite text editor.**
|
|
||||||
|
|
||||||
# nano /etc/sysctl.conf
|
|
||||||
|
|
||||||
Then, add **net.ipv4.ip_forward = 1** into that file or uncomment that line then, we'll need to save and exit that file.
|
|
||||||
|
|
||||||
net.ipv4.ip_forward = 1
|
|
||||||
|
|
||||||
![Editing Sysctl](http://blog.linoxide.com/wp-content/uploads/2015/03/sysctl-edit.png)
|
|
||||||
|
|
||||||
To enable the changes made run the following command.
|
|
||||||
|
|
||||||
# sysctl -p /etc/sysctl.conf
|
|
||||||
|
|
||||||
![Enabling Sysctl Changes](http://blog.linoxide.com/wp-content/uploads/2015/03/enabling-changes-sysctl.png)
|
|
||||||
|
|
||||||
### 2. Configuring Iptables firewall ###
|
|
||||||
|
|
||||||
We'll need to allow specific (or all of the) packets to traverse our router. Before that, we'll need to know the interface name of the network devices connected with our Linux box. To get the interface name, we can simply run the following command in a terminal or a shell.
|
|
||||||
|
|
||||||
# ifconfig -a
|
|
||||||
|
|
||||||
![Ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/03/ifconfig.png)
|
|
||||||
|
|
||||||
Here, in our box we have eth2 as network interface which is connected to the internet or a network and wlan2 is the interface where we need to forward the network packets from eth2 using iptables. So, to do so, we'll need to run the following command.
|
|
||||||
|
|
||||||
# iptables -A FORWARD -i wlan2 -o eth2 -j ACCEPT
|
|
||||||
|
|
||||||
Note: Please replace wlan2 and eth2 with the device name available in your Linux box.
|
|
||||||
|
|
||||||
Now, we'll need iptables to allow traffic for already established connections as netfilter is a stateless firewall. To do so, we'll need to run the following command.
|
|
||||||
|
|
||||||
# iptables -A FORWARD -i eth2 -o wlan2 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
|
||||||
|
|
||||||
![Forwarding with iptables](http://blog.linoxide.com/wp-content/uploads/2015/03/forwarding-iptables.png)
|
|
||||||
|
|
||||||
### 3. Configuring NAT ###
|
|
||||||
|
|
||||||
Then, at last we'll need to change the source address as eth2 on packets going out to the internet by executing the command below.
|
|
||||||
|
|
||||||
# iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
|
|
||||||
|
|
||||||
![configuring nat](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-nat.png)
|
|
||||||
|
|
||||||
### Conclusion ###
|
|
||||||
|
|
||||||
Finally, we've successfully configured Packet forwarding from one interface to another interface on our Linux machine having iptables installed as firewall solution. This article enables to connect your private interface to the internet, you don't need bridging the interfaces, you need to route packets coming in on one interface to the other one, thats all. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://linoxide.com/firewall/ip-forwarding-connecting-private-interface-internet/
|
|
||||||
|
|
||||||
作者:[Arun Pyasi][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://linoxide.com/author/arunp/
|
|
@ -1,76 +0,0 @@
|
|||||||
How to Change Default Web Browser and Email Client in Ubuntu
|
|
||||||
================================================================================
|
|
||||||
web browserUbuntu ships with a slate of default apps handily pre-installed, including Mozilla’s hugely popular Firefox web browser and Thunderbird e-mail client.
|
|
||||||
|
|
||||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/web-browser.png)
|
|
||||||
|
|
||||||
While both of these have their fans neither app is — shock — to everyone’s tastes or needs. We often get e-mails or tweets from people asking us how they can change the default browser in Ubuntu or set a different mail client as the handler for mail links, etc.
|
|
||||||
|
|
||||||
We’re not just talking about installing a different bit of software here but also how you set it as the system handler for a given file, link or content type.
|
|
||||||
|
|
||||||
It is super easy to change a whole slate of default application including web, e-mail, text editing, music and videos players, in Ubuntu. The settings panel where you can make these changes isn’t known to everyone, so we’ll take a quick look.
|
|
||||||
|
|
||||||
### How to Change the Default Browser in Ubuntu ###
|
|
||||||
|
|
||||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg)
|
|
||||||
|
|
||||||
Mozilla Firefox is a solid, open-source and reliable window on the world wide web but it’s not everyone’s browser of choice. And that’s fine.
|
|
||||||
|
|
||||||
To use a different default browser in Ubuntu you will first, rather obviously, need to install a new one. How you do this depends on the one you want:
|
|
||||||
|
|
||||||
- Open-source web browsers, like [Epiphany][1], [Chromium][2] and [IceWeasel][3], are available to install from the Ubuntu Software Center.
|
|
||||||
|
|
||||||
- Major web-browsers, like [Google Chrome][4], [Opera][5] and [Vivaldi][6], must be downloaded from each project’s official website.
|
|
||||||
|
|
||||||
Whichever browser you choose, and however you choose to install it, once you have done so you can continue on.
|
|
||||||
|
|
||||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg)
|
|
||||||
|
|
||||||
To change the default browser for opening web links click on in other applications, e.g., instant messengers, Twitter clients, e-mail, etc, you need to use the Ubuntu System Settings tool.
|
|
||||||
|
|
||||||
You can launch System Settings a number of ways. One of the fastest is to the click the Cog icon in the far-right hand corner (far left on RTL systems) and select the ‘System Settings’ menu shortcut.
|
|
||||||
|
|
||||||
1. Open ‘System Settings’
|
|
||||||
1. Select the ‘Details’ item
|
|
||||||
1. Select ‘Default Applications’ in the sidebar
|
|
||||||
1. Change the ‘Web’ entry from ‘Firefox’ to your preferred choice
|
|
||||||
|
|
||||||
That’s it.
|
|
||||||
|
|
||||||
### How To Change the Default Mail Client in Ubuntu ###
|
|
||||||
|
|
||||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg)
|
|
||||||
|
|
||||||
Ubuntu ships with Thunderbird as the default mail application. This means the app will **open automatically when you click on an email address or a [mailto link][7]** in most web-browsers, PDFs, instant messengers, and so on.
|
|
||||||
|
|
||||||
This convenience is super handy if you use Thunderbird, of course. But a lot of us don’t; we may [use a lightweight client like Geary][8], GNOME stalwart Evolution, or rely on a web-mail service like Gmail or Outlook.
|
|
||||||
|
|
||||||
To **change the default mail client in Ubuntu** from Thunderbird to another application open System Settings > Details > Default Applications. Click the drop-down menu next to ‘Mail’ and choose your preferred client from the list.
|
|
||||||
|
|
||||||
To **set Gmail as the default mail client in Ubuntu** you must first install the ‘gnome-gmail’ package by hitting the button below. Once installed open System Settings > Details > Default Applications. Click the drop-down menu next to ‘Mail’ and choose ‘Gmail’ from the list.
|
|
||||||
|
|
||||||
- [Install GNOME Gmail in Ubuntu][9].
|
|
||||||
|
|
||||||
### Going Further ###
|
|
||||||
|
|
||||||
The same steps listed above can be used to make your favourite music player open when double clicking on a music file, have an application like VLC handle your .avi and .mp4 files, and so on.
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubuntu
|
|
||||||
|
|
||||||
作者:[Joey-Elijah Sneddon][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
|
||||||
[1]:https://wiki.gnome.org/Apps/Web
|
|
||||||
[2]:https://apps.ubuntu.com/cat/applications/chromium-browser/
|
|
||||||
[3]:https://wiki.debian.org/Iceweasel
|
|
||||||
[4]:https://www.google.co.uk/chrome/browser/desktop/
|
|
||||||
[5]:http://www.opera.com/computer/linux
|
|
||||||
[6]:https://vivaldi.com/#Download
|
|
||||||
[7]:http://en.wikipedia.org/wiki/Mailto
|
|
||||||
[8]:http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update
|
|
||||||
[9]:apt://gnome-gmail
|
|
@ -0,0 +1,75 @@
|
|||||||
|
Linux 上IP转发如何帮助专用接口连接到互联网
|
||||||
|
================================================================================
|
||||||
|
大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发或者数据包转发。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现从一个连接到多个客户端机器的共享互联网或者网络连接。
|
||||||
|
|
||||||
|
这是一些启用IP转发或网络包转发方法的简单步骤。
|
||||||
|
|
||||||
|
### 1. 启用 IPv4 转发 ###
|
||||||
|
|
||||||
|
首先,我们打算在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。
|
||||||
|
|
||||||
|
$ sudo -s
|
||||||
|
|
||||||
|
# echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
|
||||||
|
![临时IP转发](http://blog.linoxide.com/wp-content/uploads/2015/03/ip-forward-temporary.png)
|
||||||
|
|
||||||
|
**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们喜欢的文本编辑器打开 /etc/sysctl.conf 文件。**
|
||||||
|
|
||||||
|
# nano /etc/sysctl.conf
|
||||||
|
|
||||||
|
然后,增加 **net.ipv4.ip_forward = 1** 到文件中,或者删除那行的注释,保存并退出文件。
|
||||||
|
|
||||||
|
net.ipv4.ip_forward = 1
|
||||||
|
|
||||||
|
![编辑 Sysctl](http://blog.linoxide.com/wp-content/uploads/2015/03/sysctl-edit.png)
|
||||||
|
|
||||||
|
运行下面的命令启用更改。
|
||||||
|
|
||||||
|
# sysctl -p /etc/sysctl.conf
|
||||||
|
|
||||||
|
![启用 Sysctl 更改](http://blog.linoxide.com/wp-content/uploads/2015/03/enabling-changes-sysctl.png)
|
||||||
|
|
||||||
|
### 2. 配置 Iptables 防火墙 ###
|
||||||
|
|
||||||
|
我们需要允许特定的(或者所有的)数据包通过我们的路由器。在这之前,我们要知道连接我们 Linux 的网络设备的接口名称。我们可以通过在终端或者 shell 运行以下命令获得接口名称。
|
||||||
|
|
||||||
|
# ifconfig -a
|
||||||
|
|
||||||
|
![Ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/03/ifconfig.png)
|
||||||
|
|
||||||
|
这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要做到这点,我们需要运行以下命令。
|
||||||
|
|
||||||
|
# iptables -A FORWARD -i wlan2 -o eth2 -j ACCEPT
|
||||||
|
|
||||||
|
注意:请用你 Linux 机器中的可用设备名称替换 wlan2 和 eth2。
|
||||||
|
|
||||||
|
现在,由于网络过滤器是一个无状态的防火墙,我们要用 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。
|
||||||
|
|
||||||
|
# iptables -A FORWARD -i eth2 -o wlan2 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
|
||||||
|
![用 iptables 转发](http://blog.linoxide.com/wp-content/uploads/2015/03/forwarding-iptables.png)
|
||||||
|
|
||||||
|
### 3. 配置 NAT ###
|
||||||
|
|
||||||
|
然后,最后我们需要通过执行下面的命令修改发送到互联网的数据包的源地址为 eth2。
|
||||||
|
|
||||||
|
# iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
|
||||||
|
|
||||||
|
![配置 nat](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-nat.png)
|
||||||
|
|
||||||
|
### 总结 ###
|
||||||
|
|
||||||
|
最后,用安装的 iptables 作为防火墙解决方案,我们在我们的 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章允许你的专用接口连接到互联网,你不需要桥接接口,而是路由从一个接口进来的数据包到另一个接口,就是这些。如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://linoxide.com/firewall/ip-forwarding-connecting-private-interface-internet/
|
||||||
|
|
||||||
|
作者:[Arun Pyasi][a]
|
||||||
|
译者:[ictlyh](https://github.com/ictlyh)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://linoxide.com/author/arunp/
|
@ -0,0 +1,77 @@
|
|||||||
|
如何在 Ubuntu 中更改默认浏览器和 Email 客户端
|
||||||
|
================================================================================
|
||||||
|
Ubuntu 自带了一些已经预装的默认应用程序,包括非常流行的 Mozilla 火狐浏览器和 Thunderbird 的 e-mail 客户端。
|
||||||
|
|
||||||
|
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/web-browser.png)
|
||||||
|
|
||||||
|
尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们怎样可以在 Ubuntu 上更改默认浏览器或者设置处理邮件链接的不同的电子邮件客户端等。
|
||||||
|
|
||||||
|
我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置系统处理应用。
|
||||||
|
|
||||||
|
在 Ubuntu 中更改默认应用程序,包括浏览器、电子邮件客户端、文本编辑器、音乐和视频播放器都非常的简单。但并不是每个人都知道更改这些的设置面板在哪里,让我们来快速看一下吧。
|
||||||
|
|
||||||
|
### 如何在 Ubuntu 上更改默认浏览器 ###
|
||||||
|
|
||||||
|
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg)
|
||||||
|
|
||||||
|
Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口,但它并不是每个人的选择。这都没关系。
|
||||||
|
|
||||||
|
在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器:
|
||||||
|
|
||||||
|
- 开源浏览器,例如 [Epiphany][1], [Chromium][2] 和 [IceWeasel][3],可以从 Ubuntu 软件中心安装。
|
||||||
|
|
||||||
|
- 主流浏览器,例如 [Google Chrome][4], [Opera][5] 和 [Vivaldi][6] 必须从各自项目的官方网站上下载。
|
||||||
|
|
||||||
|
不管你选择哪个浏览器,不管你选择怎样安装,完成之后你就可以继续了。
|
||||||
|
|
||||||
|
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg)
|
||||||
|
|
||||||
|
点击其它应用上的链接,例如及时通讯软件、Twitter 客户端、 e-mail,要更改打开网页的默认浏览器,你需要用到 Ubuntu 系统设置工具。
|
||||||
|
|
||||||
|
你可以用多种方法打开系统设置。其中一种最快的方式是点击右上角(RTL系统是左上角)的 Cog 图标并选择‘系统设置’菜单快捷方式。
|
||||||
|
|
||||||
|
1. 打开‘系统设置’
|
||||||
|
1. 选择‘详细’选项
|
||||||
|
1. 在侧边栏选择‘默认应用程序’
|
||||||
|
1. 把 ‘Web’ 条目的 ‘火狐’ 改为你想要的选项
|
||||||
|
|
||||||
|
就是这样。
|
||||||
|
|
||||||
|
### 如何在 Ubuntu 上更改默认的邮件客户端 ###
|
||||||
|
|
||||||
|
![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg)
|
||||||
|
|
||||||
|
Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着 当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。
|
||||||
|
|
||||||
|
当然,如果你使用 Thunderbird,这真的很方便。但是我们很多人并非如此; 我们可能**[使用像 Geary 这样的轻量级客户端][8]**,GNOME stalwart Evolution,或者依靠像 Gmail 或者 Outlook 这样的网络邮件服务。
|
||||||
|
|
||||||
|
在 Ubuntu 上从 Thunderbird **更改默认邮件客户端** 到另一个应用程序,打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择你喜欢的客户端。
|
||||||
|
|
||||||
|
**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择 ‘Gmail’。
|
||||||
|
|
||||||
|
- [在 Ubuntu 上安装 GNOME Gmail][9]
|
||||||
|
|
||||||
|
### 更多 ###
|
||||||
|
|
||||||
|
上述同样的步骤可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubuntu
|
||||||
|
|
||||||
|
作者:[Joey-Elijah Sneddon][a]
|
||||||
|
译者:[ictlyh](https://github.com/ictlyh)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||||
|
[1]:https://wiki.gnome.org/Apps/Web
|
||||||
|
[2]:https://apps.ubuntu.com/cat/applications/chromium-browser/
|
||||||
|
[3]:https://wiki.debian.org/Iceweasel
|
||||||
|
[4]:https://www.google.co.uk/chrome/browser/desktop/
|
||||||
|
[5]:http://www.opera.com/computer/linux
|
||||||
|
[6]:https://vivaldi.com/#Download
|
||||||
|
[7]:http://en.wikipedia.org/wiki/Mailto
|
||||||
|
[8]:http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update
|
||||||
|
[9]:apt://gnome-gmail
|
Loading…
Reference in New Issue
Block a user