On 04.09.2016 15:18, Ulf Volmer wrote:> On 09/03/2016 07:34 PM, Walter H. wrote: > >> if I would need an additional IPv6 address I'd just add >> IPV6ADDR_SECONDARIES="ipv6addr" >> to this file; if I would need an additional IPv4 address this works only >> by a virtual device >> e.g. eth0:1 like this: > That's not true, you can add ipv4 address to the interface in the same way: > > | IPADDR2=172.17.170.101 > | NETMASK2=255.255.255.0 > > There is no need to create a virtual network device.ah ok, and the other values? IPADDR2=192.168.1.10 BROADCAST2=192.168.1.255 <-- NETMASK2=255.255.255.0 NETWORK2=192.168.1.0 <-- GATEWAY2=192.168.1.1 <-- in case they don't match the first IP address? Thanks, Walter
On 09/04/2016 04:40 PM, Walter H. wrote:> On 04.09.2016 15:18, Ulf Volmer wrote:>> That's not true, you can add ipv4 address to the interface in the same >> way: >> >> | IPADDR2=172.17.170.101 >> | NETMASK2=255.255.255.0 >> >> There is no need to create a virtual network device. > ah ok, and the other values?no other values needed. i assume that the second ip is in the same subnet as the first one.> IPADDR2=192.168.1.10 > BROADCAST2=192.168.1.255 <-- > NETMASK2=255.255.255.0 > NETWORK2=192.168.1.0 <-- > GATEWAY2=192.168.1.1 <-- > > in case they don't match the first IP address?I'm not sure at this point. If you have to add a second ip in another different network maybe you need a virtual device. best regards Ulf
On Sun, September 4, 2016 9:40 am, Walter H. wrote:> On 04.09.2016 15:18, Ulf Volmer wrote: >> On 09/03/2016 07:34 PM, Walter H. wrote: >> >>> if I would need an additional IPv6 address I'd just add >>> IPV6ADDR_SECONDARIES="ipv6addr" >>> to this file; if I would need an additional IPv4 address this works >>> only >>> by a virtual device >>> e.g. eth0:1 like this: >> That's not true, you can add ipv4 address to the interface in the same >> way: >> >> | IPADDR2=172.17.170.101 >> | NETMASK2=255.255.255.0 >> >> There is no need to create a virtual network device. > ah ok, and the other values? > > IPADDR2=192.168.1.10 > BROADCAST2=192.168.1.255 <-- > NETMASK2=255.255.255.0 > NETWORK2=192.168.1.0 <-- > GATEWAY2=192.168.1.1 <--Interesting... With these settings, namely GATEWAY2=..., how the arbitration is done (in networks stack) which of gateways is used for packets to be sent outside of networks the machine is on? As far as I know FreeBSD, there can be only one gateway (BTW, synonym: default gateway). Theoretically, the machine can have more than one gateway, but for that you need to have specially configured firewall/nat. Is this somehow different in Linux, and Linux does that auto-magically? Valeri> > in case they don't match the first IP address? > > Thanks, > Walter > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On 09/04/2016 05:00 PM, Ulf Volmer wrote:>> IPADDR2=192.168.1.10 >> BROADCAST2=192.168.1.255 <-- >> NETMASK2=255.255.255.0 >> NETWORK2=192.168.1.0 <-- >> GATEWAY2=192.168.1.1 <-- >> >> in case they don't match the first IP address? > > I'm not sure at this point. If you have to add a second ip in another > different network maybe you need a virtual device.OK, some testing has been done. you have to specify IPADDR=192.168.0.10 NETMASK=255.255.255.0 NETWORK=192.168.0.0 GATEWAY=192.168.0.1 IPADDR2=192.168.2.10 NETMASK2=255.255.255.0 NETWORK2=192.168.2.0 please note, that you have to specify only one GATEWAY, there can be only one default gateway active. best regards Ulf
Valeri, not on list as it does not pertain to Linux. On Sun, Sep 04, 2016 at 10:25:23AM -0500, Valeri Galtsev wrote:>...> > IPADDR2=192.168.1.10 > > BROADCAST2=192.168.1.255 <-- > > NETMASK2=255.255.255.0 > > NETWORK2=192.168.1.0 <-- > > GATEWAY2=192.168.1.1 <-- > > Interesting... With these settings, namely GATEWAY2=..., how the > arbitration is done (in networks stack) which of gateways is used for > packets to be sent outside of networks the machine is on? > > As far as I know FreeBSD, there can be only one gateway (BTW, synonym: > default gateway). Theoretically, the machine can have more than one > gateway, but for that you need to have specially configured firewall/nat. > Is this somehow different in Linux, and Linux does that auto-magically? >Decades ago, I was running Solaris x86 at home. My internet connection was a 24/7 14.4KBaud phone connection to my ISP. I then added my first broadband cable connection. During the transition I investigated dual gateways. At that time, Solaris just alternated between the two. It wasn't load balancing, and once a connection was made it stayed with that interface if it was up. Just new connections alternately were sent via one or the other gateway interfaces. Jon -- Jon H. LaBadie jon at jgcomp.com 11226 South Shore Rd. (703) 787-0688 (H) Reston, VA 20190 (703) 935-6720 (C)