Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1- static IP address

2- dhcp IP address




https://linuxize.com/post/how-to-configure-static-ip-address-on-ubuntu-18-04/




Image Added







Code Block
titleip add command
sudo ifconfig eth1 down
sudo ip addr add 10.10.1.20/24 dev eth1
sudo ifconfig eth1 up

vagrant@srv12:~$ ip addr
. . . 
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:6d:f5:a6 brd ff:ff:ff:ff:ff:ff
    inet 10.10.1.20/24 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe6d:f5a6/64 scope link
       valid_lft forever preferred_lft forever


Code Block
titledhcp
2- dhcp IP address
root@kali:~# vi /etc/network/interfaces
auto enp0s8
iface enp0s8 inet dhcp



sudo /etc/init.d/networking restart




Code Block
titleip add
1- static ip addr and dns
1- set IP@
2- restart
3- set resolv.conf

Static IP@:

root@kali:~# vi /etc/network/interfaces
auto enp0s8
iface enp0s8 inet static
address 192.168.221.190
netmask 255.255.255.0
gateway 192.168.221.1
dns-nameservers 8.8.8.8



sudo /etc/init.d/networking restart

systemctl  restart networking ??
Code Block
titledhcp
2- dhcp IP address
root@kali:~# vi /etc/network/interfaces
auto enp0s8
iface enp0s8 inet dhcp



sudo /etc/init.d/networking restart