UBUNTU12.04 System, dual network card: eth0, eth1. DB set to public IP, and LAN IP,
This allows the computer to access various IPs within the LAN, and can be accessed worldwide, using SSH or Remote Desktop tool.
Then began to implement:
First step: Modify the Network settings:
sudo vim/etc/network/interfaces
Step Two: Restart the network Service
sudo/etc/init.d/networking restart
Note the error message may pop up at this point:
Rtnetlink Answers:file exists
Failed to bring up eth1.
why.
in the first step of the setup, the eth0,eth1 are set up a gateway, respectively, the extranet gateway and LAN Gateway. This poses a problem because the default gateway is only one.
Workaround: Remove the LAN gateway and restart the Network service. ---------OK, enjoy your network system.
There are also netizens said you can execute the following command:
IP addr Flush Dev eth1
UBUNTU14.04 in the networking Stop/start/restart can not be used ...
To revert back to the 13.10 Networking scripts go:
Https://github.com/metral/restore_networking
This would replace the 14.04 scripts with the one used in 13.10.
$sudo apt-get Install git
$sudo git clone https://github.com/metral/restore_networking.git
$CD restore_networking/
$sudo./restore_networking.sh
miguel@u1404server:~$ sudo service networking restart
Networking stop/waiting
Networking start/running
Or not replaced, use the following command instead:
sudo ifdown--exclude=lo-a && sudo ifup--exclude=lo-a
Write it to the script file each time you execute the script file:
Note: If the eth1 eht2 respectively corresponds to the external network and the intranet, its settings correspond to DHCP and manual, the intranet gateway does not set up, otherwise, because two gateways ( a DHCP acquisition-set to automatic acquisition, a manual setting ), the system will not be able to connect the network ...