routing and how to change DNS
default route used to go to the Internet
[root@localhost ~]# ip route add 10.0.1.0/24 via 192.168.174.131
[root@localhost ~]# ip route show
default via 192.168.174.2 dev ens33 proto static metric 100
10.0.1.0/24 via 192.168.174.131 dev ens33
192.168.174.0/24 dev ens33 proto kernel scope link src 192.168.174.131 metric 100
[root@localhost ~]#
DNS is configurable here:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=80d3cc7f-4474-4a88-b534-679859a360ca
DEVICE=ens33
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
DNS1=8.8.8.8
DNS2=8.8.8.4
PEERDNS=yes
PEERROUTES=yes
[root@localhost ~]# ip route add 10.0.1.0/24 via 192.168.174.131
[root@localhost ~]# ip route show
default via 192.168.174.2 dev ens33 proto static metric 100
10.0.1.0/24 via 192.168.174.131 dev ens33
192.168.174.0/24 dev ens33 proto kernel scope link src 192.168.174.131 metric 100
[root@localhost ~]#
DNS is configurable here:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=80d3cc7f-4474-4a88-b534-679859a360ca
DEVICE=ens33
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
DNS1=8.8.8.8
DNS2=8.8.8.4
PEERDNS=yes
PEERROUTES=yes
after we edit /etc/sysconfig/network-scripts/ifcfg-ens33
we have to bounce the network card
[root@localhost ~]# nmcli connection down ens33 ; nmcli con up ens33
Connection 'ens33' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/10)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/11)
Comments
Post a Comment