netsh command to change to static ip only changes my default gateway? - command-line

I'm trying to change my ip address to a static ip addres with the following netsh command:
netsh interface ip set address name="Wi-Fi" static x.x.x.x 255.255.255.0 x.x.x.x 1
But this only changes my default gateway and doesn't affect anything else. Sometimes it doesn't even affect the gateway. The result looks like this:
What am i doing wrong?

You can try and explicitly state all the values:
netsh interface ip set address name="Wi-Fi" source=static addr=x.x.x.x mask=255.255.255.0 gateway=x.x.x.x 1

Related

I can't ping google.com in GNS3

Good afternoon to all! I ran into a problem when setting up my network. The essence of the problem is that I can't ping the address google.com , but I can ping Google DNS 8.8.8.8 I can't do it on a Cisco IOSv router that is connected to the internet using NAT and also on other devices behind it I can't do it. But to check, I connected a PC and was able to ping google.com . Of course, I tried to set up NAT on the router, prescribed NAT INSIDE and NAT OUTSIDE, but it didn't help. I will also attach all the screenshots to make it clear. Most likely I just missed something.
My network:
enter image description here
NAT settings: enter image description here
Ping to 8.8.8.8 and google.com on PC1 and R1: enter image description here
R1 ip route:
Router#show ip route
Gateway of last resort is 192.168.45.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.168.45.2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, GigabitEthernet0/1
L 10.1.1.1/32 is directly connected, GigabitEthernet0/1
192.168.45.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.45.0/24 is directly connected, GigabitEthernet0/0
L 192.168.45.100/32 is directly connected, GigabitEthernet0/0
PC1 config:
PC1> show ip
NAME : PC1[1]
IP/MASK : 192.168.45.129/24
GATEWAY : 192.168.45.2
DNS : 192.168.45.2
DHCP SERVER : 192.168.45.254
DHCP LEASE : 1797, 1800/900/1575
DOMAIN NAME : localdomain
MAC : 00:50:79:66:68:00
LPORT : 10003
RHOST:PORT : 127.0.0.1:10004
MTU: : 1500
R1 config:
Router#show startup-config
version 15.6
hostname Router
no ip domain lookup
ip cef
no ipv6 cef
multilink bundle-name authenticated
redundancy
!
interface GigabitEthernet0/0
ip address 192.168.45.100 255.255.255.0
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/1
ip address 10.1.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
duplex auto
speed auto
media-type rj45
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip nat inside source list 100 interface GigabitEthernet0/0 overload
ip route 0.0.0.0 0.0.0.0 192.168.45.2
!
!
access-list 100 permit ip any any
!
control-plane
!
I was given an answer from GNS3 Forum (from Ean Towne
GNS3 Moderator). Here 's what he wrote:
"You have disabled the ability for the router (R1) to DNS lookups, and also have not specified the IP address(es) of the DNS to use"
R1(config)# ip name-server 8.8.8.8 1.1.1.1
R1(config)# ip domain lookup
"People often add the "no ip domain lookup" by default in order to remove failed lookups when making typos. However they do not necessarily think about the effect of the same"
https://www.gns3.com/community/support/i-cant-ping-google-com-in-gns3

Script to toggle IPV4 IP address, between the "obtain IP address automatically" settings, and a specific IP address and Subnet mask in windows cmd

I am looking for a way to change the IPV4 IP address settings to a specific IP and Subnet mask, but also to change it to get the IP address automatically. I see plenty of resources for setting the IPV4 IP and DNS settings in windows cmd, but I don't see where i can change it to the "Obtain IP address automatically" setting.
Basically, I need to quickly switch my settings from the default IP wifi settings to a specific IP address and subnet mask (well, the default one, but it needs to be set when changing IPV4 settings), and back when I need it.
DHCP is used to obtain IP address automatically. When you'd want to revert the interface to using DHCP again, just run the following commands.
netsh interface ip set address name="<adapter-name>" dhcp
netsh interface ip set dns name="<adapter-name>" dhcp
ipconfig /release <adapter-name> && ipconfig /renew <adapter-name>

How to fix ipaddress in CentOS?

I am using VMWare 10, in that installed CentOS 6.5 with two networking interfaces (eth0,eth1).
When I try to use the vmware, every time the ipaddress changes.
How to make the IP address constant (not a static IP address)?
Vmware will by default allocate dhcp ip addesses. In order to have static IP address, please assign static IP address in Centos using below steps
Static IP assignment for eth0
cat /etc/sysconfig/network-scripts/ifcfg-eth0
Sample output:
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="xx:xx:xx:xx:xx:xx"
NM_CONTROLLED="yes"
ONBOOT="no"
TYPE="Ethernet"
Configure eth0:
In above you can look that IP address is assigned dynamically using dhcp. Change this to below, make sure you aren't changing hwaddr, device - leave it unchanged.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="xx:xx:xx:xx:xx:xx"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR=192.168.1.2
NETMASK=255.255.255.0
service network restart
It will work now.

configure ip for bitnami owncloud virtual appliance

I installed Bitnami owncloud virtual appliance stack on Virtual box and within no time, I was able to sync files to and from this box. However, the main problem with Virtual Box is that the IP address keeps changing when the owncloud instance is powered off and then turned back on - which makes sense. Is there any way to keep the server IP static so that we don't need to configure the clients everytime the IP is changed.
You could change the config (from auto to static) in the following way
sudo vi /etc/network/interfaces (“vi” or “nano”)
iface eth0 inet static
address 192.168.0.100
# your own IP
netmask 255.255.255.0
# network mask
gateway 192.168.0.1
# standard gateway (router)
dns-nameservers 192.168.0.1 8.8.8.8
# DNS (optional)
/etc/init.d/networking restart (restart network)
ifconfig
for the IP addresses check or you “shutdown –h now” (reboot)). Please, keep in mind that multiple copies need multiple IP's. In Virtual Box remember to switch between NAT and Bridge - if required.

Stunnel - Specify Outbound IP?

Is there any way to specify a particular outbound IP address for stunnel? Right now, it's always using the main IP of the server, but I'd like it to use a specific outbound IP address.
I actually found my own answer on this one - the "local" directive.
local = host
IP of the outgoing interface is used as source for remote connections.
Use this option to bind a static local IP address, instead.