Hello everybody… networking is not my job so my simple question is aimed to the experts …
Can Vyos do the following? (copied from a Cisco router config)
interface FastEthernet4
ip address 1.2.3.4 255.255.255.0 secondary
ip address 1.2.3.5 255.255.255.0
In other words… handle a secondary ip on the same NIC ?
Sorry… not so simple. Everything said in this link http://forum.vyos.net/showthread.php?tid=6850 is true but the solution is not my requirement. I need one nic to handle a secondary public IP.
Can someone post a detailed config to do this?
Well, according to the VYATTA documentation that I have, it is that simple. You just add the second IP address on it. You asked if VyOS could do it, and it can. You haven’t even tried it? How do you know it won’t work? You are basing your claim off one old post? Weird.
Tried yesterday. The old post still rules.
Your quote ‘It is as simple as “set interfaces ethernet eth1 address ‘192.168.0.1/24’”’ works on a LAN. But I am talking about public IPs provided by my ISP.
Like this:
interfaces {
ethernet eth0 {
address 1.2.3.4/24
address 1.2.3.5/24
hw-id 00:0c:29:44:3b:0f
}
loopback lo {
}
}
system gateway-address 1.2.3.1
If you ping 1.2.3.4 from outer internet you have a reply from first adrress but nothing pinging on the second one.
interface FastEthernet4
ip address 1.2.3.5 255.255.255.0 secondary
ip address 1.2.3.4 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
Still waiting for someone showing how this could be achieved in Vyos.
It really depends upon what you’re looking for out of that secondary IP. VyOS only responds to pings on the first IP address without additional configuration. Additional IP addresses assigned are still available for use but you won’t get a ping response from them unless you explicitly add NAT rules to direct the traffic to something to respond. After adding additional IP addresses on the WAN facing nic you can still use those to NAT to/from various resources behind your vyos router. Here’s a sample config that I use from some production routers I run. Hopefully this helps.
interfaces ethernet eth0 {
address 1.1.1.2/24
address 1.1.1.3/24
address 1.1.1.4/24
firewall {
in {
name outside_in
}
local {
name router_in
}
}
}
The problem I had was simply a misconfiguration on my ISP’s side who didn’t reset the second IP to be assigned to the new MAC address of my newly installed box.
However system gateway-address must to be declared on Vyos configuration for internet access. After that no need to do something special on routes .
And NAT translations remain just the same as I had on my CISCO router.