If the pc is network server, check if the ip_forward is enabled with the command:
cat > /proc/sys/net/ipv4/ip_forward
(0) mean not enabled, to enable open the file /etc/sysctl.conf and enable the line:
net.ipv4.ip_forward = 1
Enable the nat and masquerade in the iptables with this iptable rules:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
Ubuntu has gui network manager name NetworkManager that gets the ip from dhcp of router, the configuration files are in the /etc/NetworkManager
directory, for more details read the man type in terminal:
man NetworkManager
The command line network manager files are in the /etc/network, to get the address form dhcp server open the
file /etc/Network/interfaces and write these lines, replace the eth0 with the network card name:
# The loopback network interface
auto lo
iface lo inet loopback
# confgiure the eth0 for dhcp
auto eth0
iface eth0 inet dhcp
To list the network interfaces card names run the command:
ls /sys/class/net
For the static ip address add these lines to the file /etc/network/interfaces:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.10
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
For these new settings to take effect you need to restart networking services using the following command:
sudo /etc/init.d/networking restart
nameserver 192.168.1.1
sudo /bin/hostname
To set the hostname directly you can become root and run:
sudo /bin/hostname newname
When your system boots it will automatically read the hostname from the file /etc/hostname.
sshfs 192.168.1.102:/root tmp
fusermount -u tmp (umount the dir)
mount -t ntfs 192.168.1.102:/home/user tmp
Connect with ssh:
ssh 192.168.1.102
To copy the files to [email protected]:/store/base directory, open the file dir and run the command:
scp * [email protected]:/store/base/