Currently I directly type the following command to bind static ip for eth0 via normal user.
$sudo ifconfig eth0:1 192.168.20.66
How do I run this command when boot Ubuntu without typing password?
Currently I directly type the following command to bind static ip for eth0 via normal user.
$sudo ifconfig eth0:1 192.168.20.66
How do I run this command when boot Ubuntu without typing password?
My eth0 is using DHCP to get IP address for Internet. However I still need to set some static IP for my LAN. The following is my setting in /etc/network/interface. Any problem on the script ? I always failed when I try to start network.
I checked the IP via ifconfig. and found eth0:3 is set but others. May I know what's the problem?
1 auto lo
2 iface lo inet loopback
3
4 #auto eth0
5 #iface eth0 inet dhcp
6
7 auto eth0:1
8 iface eth0:1 inet static
9 address 192.168.20.222
10 netmask 255.255.255.0
11 gateway 192.168.20.1
12
13 auto eth0:2
14 iface eth0:2 inet static
15 address 192.168.30.222
16 netmask 255.255.255.0
17 gateway 192.168.30.1
18
19 auto eth0:3
20 iface eth0:3 inet static
21 address 192.168.211.222
22 netmask 255.255.255.0
23 gateway 192.168.221.1